lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 26 Aug 2022 15:23:52 +0800
From:   shangxiaojing <shangxiaojing@...wei.com>
To:     Daniel Bristot de Oliveira <bristot@...hat.com>
CC:     <mingo@...hat.com>, <peterz@...radead.org>,
        <vincent.guittot@...aro.org>, <juri.lelli@...hat.com>,
        <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
        <bsegall@...gle.com>, <mgorman@...e.de>, <vschneid@...hat.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] sched/deadline: Add compare_task_rq helper


On 2022/8/26 15:10, Daniel Bristot de Oliveira wrote:
> On 8/26/22 05:11, Shang XiaoJing wrote:
>> Wrap repeated code in helper function compare_task_rq, which return true
>> if there is no deadline task on the rq at all, or task's deadline
>> earlier than the rq.
>>
>> Signed-off-by: Shang XiaoJing <shangxiaojing@...wei.com>
>> ---
>>   kernel/sched/deadline.c | 23 +++++++++++------------
>>   1 file changed, 11 insertions(+), 12 deletions(-)
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index d116d2b9d2f9..4a40a462717c 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -1810,6 +1810,13 @@ static void yield_task_dl(struct rq *rq)
>>   
>>   #ifdef CONFIG_SMP
> I see the value of this helper, but "compare_task_rq" is making things more confuse.
>
> Choose a more descriptive name, like, dl_task_is_earliest_deadline() ?

ok, i'll find a better name, or take your advice directly in v2.

>> +static inline bool compare_task_rq(struct task_struct *p, struct rq *rq)
>> +{
>> +	return (!rq->dl.dl_nr_running ||
>> +		dl_time_before(p->dl.deadline,
>> +			       rq->dl.earliest_dl.curr));
>> +}
>> +
> -- Daniel

Thanks :-) ,

Shang XiaoJing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ