All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
	K Prateek Nayak <kprateek.nayak@amd.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
	kernel test robot <yi1.lai@intel.com>,
	Peter Zijlstra <peterz@infradead.org>, <oe-lkp@lists.linux.dev>,
	<lkp@intel.com>, <linux-kernel@vger.kernel.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 15:53:43 +0800	[thread overview]
Message-ID: <awPxB4E9+mhwr3BT@chenyu-dev> (raw)
In-Reply-To: <CAKfTPtCiENFwCzFnsA-p8+zDSh9riv5G-ZsiEU80+4QhrpYt=A@mail.gmail.com>

On Mon, Nov 23, 2026 at 08:48:08AM +0100, Vincent Guittot wrote:
> On Mon, 23 Nov 2026 at 08:16, K Prateek Nayak <kprateek.nayak@amd.com> wrote:
> >
> > 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>
> 
> There is a similar patch on the mailing list at
> https://lore.kernel.org/all/20261123001213.7609-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
>

Above fix was earlier, so I'd like to give the credit to him, let me reply to this patch with my Tested-by
Thanks Prateek, would you mind also reply to that patch?

thanks,
Chenyu
 
> > > ---
> > >  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
> >

      reply	other threads:[~2026-11-23  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  0:47 [linus:master] [sched/fair] 486c3d06b9: stress-ng.switch.ops_per_sec 33.3% regression kernel test robot
2026-11-23  6:56 ` Chen Yu
2026-11-23  7:16   ` K Prateek Nayak
2026-11-23  7:48     ` Vincent Guittot
2026-11-23  7:53       ` Chen Yu [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=awPxB4E9+mhwr3BT@chenyu-dev \
    --to=yu.c.chen@intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=kprateek.nayak@amd.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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.