From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Chen Yu <yu.c.chen@intel.com>,
kernel test robot <yi1.lai@intel.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: <oe-lkp@lists.linux.dev>, <lkp@intel.com>,
<linux-kernel@vger.kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
<aubrey.li@linux.intel.com>
Subject: Re: [linus:master] [sched/fair] 486c3d06b9: stress-ng.switch.ops_per_sec 33.3% regression
Date: Mon, 23 Nov 2026 12:46:29 +0530 [thread overview]
Message-ID: <207b8999-73f3-4173-8a2e-8e9ee3b1a767@amd.com> (raw)
In-Reply-To: <awPjsi/FiElpwjM+@chenyu-dev>
Hello Chenyu,
On 11/23/2026 12:26 PM, Chen Yu wrote:
> I fed this to AI and asked it to reproduced it on a server, later AI told me:
> - int h_nr_runnable = 0;
> + int h_nr_runnable = 1;
> was missing in dequeue_hierarchy() from https://lore.kernel.org/all/20261112083447.25603-1-kprateek.nayak@amd.com/
> when merging into 486c3d06b902
>
> From 850d8788c72d6ae459034b85584cd5ea01df920e Mon Sep 17 00:00:00 2001
> From: Chen Yu <yu.c.chen@intel.com>
> Date: Mon, 23 Nov 2026 14:27:20 +0800
> Subject: [PATCH] sched/fair: Fix h_nr_runnable leak in dequeue_hierarchy()
>
> commit 486c3d06b902 ("sched/fair: Avoid transient double
> accounting for delayed tasks") changed the default of h_nr_runnable in
> dequeue_hierarchy() from 0 to 1 and only cleared it for an already
> delayed entity:
>
> int h_nr_runnable = 1;
> ...
> /* Already accounted via set_delayed(). */
> if (se->sched_delayed)
> h_nr_runnable = 0;
>
> The adjust of h_nr_runnable to 1 was lost when merging into vanilla,
> h_nr_runnable is now 0 for every dequeue, which breaks logic consuming
> h_nr_runnable.
>
> Bring back the adjustment for h_nr_runnable.
>
> [1] https://lore.kernel.org/all/20261112083447.25603-1-kprateek.nayak@amd.com/
>
> Fixes: 486c3d06b902 ("sched/fair: Avoid transient double accounting for delayed tasks")
> Reported-by: kernel test robot <yi1.lai@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202611230853.e2e6401-lkp@intel.com
> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index da0d9e19c457..8a55571b9719 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8242,7 +8242,7 @@ static void dequeue_hierarchy(struct task_struct *p, int flags)
> {
> struct sched_entity *se = &p->se;
> bool task_throttled = flags & DEQUEUE_THROTTLE;
> - int h_nr_runnable = 0;
> + int h_nr_runnable = 1;
Sorry for not spotting that earlier on the tip! Feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
> int h_nr_idle = task_has_idle_policy(p);
> bool dequeue = true;
>
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2026-11-23 7:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 0:47 kernel test robot
2026-11-23 6:56 ` Chen Yu
2026-11-23 7:16 ` K Prateek Nayak [this message]
2026-11-23 7:48 ` Vincent Guittot
2026-11-23 7:53 ` Chen Yu
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=207b8999-73f3-4173-8a2e-8e9ee3b1a767@amd.com \
--to=kprateek.nayak@amd.com \
--cc=aubrey.li@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=yi1.lai@intel.com \
--cc=yu.c.chen@intel.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®