From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Chen Yu <yu.chen.surf@gmail.com>, Chen Yu <yu.c.chen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Valentin Schneider <vschneid@redhat.com>,
Chunxin Zang <zangchunxin@lixiang.com>,
<linux-kernel@vger.kernel.org>,
Oliver Sang <oliver.sang@intel.com>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] sched/eevdf: Fix wakeup-preempt by checking cfs_rq->nr_running
Date: Wed, 25 Sep 2024 10:24:35 +0530 [thread overview]
Message-ID: <faf91c59-1c5c-d859-a994-88e49236e1e7@amd.com> (raw)
In-Reply-To: <CADjb_WRBu8+zhO3ynHE4gferJhvZ=o9Gq1_rUisz143ivjkS0g@mail.gmail.com>
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
prev parent reply other threads:[~2024-09-25 4:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 7:21 Chen Yu
2024-09-23 7:33 ` Oliver Sang
2024-09-24 10:27 ` K Prateek Nayak
2024-09-24 13:10 ` Chen Yu
2024-09-25 4:54 ` K Prateek Nayak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=faf91c59-1c5c-d859-a994-88e49236e1e7@amd.com \
--to=kprateek.nayak@amd.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=yu.c.chen@intel.com \
--cc=yu.chen.surf@gmail.com \
--cc=zangchunxin@lixiang.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®