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]
Message-ID: <faf91c59-1c5c-d859-a994-88e49236e1e7@amd.com>
Date: Wed, 25 Sep 2024 10:24:35 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Chen Yu <yu.chen.surf@...il.com>, Chen Yu <yu.c.chen@...el.com>
CC: Peter Zijlstra <peterz@...radead.org>, Dietmar Eggemann
	<dietmar.eggemann@....com>, Steven Rostedt <rostedt@...dmis.org>, Valentin
 Schneider <vschneid@...hat.com>, Chunxin Zang <zangchunxin@...iang.com>,
	<linux-kernel@...r.kernel.org>, Oliver Sang <oliver.sang@...el.com>, Ingo
 Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>, Vincent
 Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH] sched/eevdf: Fix wakeup-preempt by checking
 cfs_rq->nr_running

Hello Chenyu,

On 9/24/2024 6:40 PM, Chen Yu wrote:
> [..snip..]
>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>> index 225b31aaee55..2859fc7e2da2 100644
>>> --- a/kernel/sched/fair.c
>>> +++ b/kernel/sched/fair.c
>>> @@ -1025,7 +1025,7 @@ static bool update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se)
>>>        /*
>>>         * The task has consumed its request, reschedule.
>>>         */
>>> -     return true;
>>> +     return (cfs_rq->nr_running > 1);
>>
>> Was there a strong reason why Peter decided to use "rq->nr_running"
>> instead of "cfs_rq->nr_running" with PREEMPT_SHORT in update_curr()?
>>
>> I wonder if it was to force a pick_next_task() cycle to dequeue a
>> possibly delayed entity
>>   but AFAICT, "cfs_rq->nr_running" should
>> account for the delayed entity still on the cfs_rq and perhaps the
>> early return in update_curr() can just be changed to use
>> "cfs_rq->nr_running". Not sure if I'm missing something trivial.
>>
> 85e511df3cec changes
> if (cfs_rq->nr_running > 1)  resched
> to
> if (rq->nr_running == 1) not_resched
> which does lower the bar to trigger resched
> 
> Yes, I think your proposal make sense, the resched should only
> be triggered between 2 cfs tasks,
> and the restore to update_deadline() is not needed, something like below
> in update_curr() could also work:
> 
> if (cfs_rq->nr_running == 1)
>        return;

That seems better IMO unless there was a strong reason for the original
change to use rq->nr_running :)

> 
> thanks,
> Chenyu

-- 
Thanks and Regards,
Prateek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ