[PATCH 0/4] sched: The newidle balance regression

Peter Zijlstra posted 4 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH 0/4] sched: The newidle balance regression
Posted by Peter Zijlstra 1 month, 1 week ago
Hi!

So most of you ran into Chris' commit 155213a2aed4 ("sched/fair: Bump
sd->max_newidle_lb_cost when newidle balance fails") [*]

And I posted a patch with a few alternative options. And while I've heard back
from a number of you, indicating that NI_TARGET (the effective revert) works
for you. Not many tested TARGET+RANDOM (thanks Adam!).

In my limited schbench testing that combination isn't horrible, and per Adam
that combination also doesn't suck for him. Chris, could you please see what
this does for your machines with your actual workload?

Anyway, here are a few patches that basically do the revert and introduce the
proportional newidle balance -- the NI_TARGET+NI_RANDOM equivalent.

Also at:

  git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/newidle

Please all, give it a whirl. Hopefully I didn't wreck it, its Friday after all :-)

[*] https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle.com
Re: [PATCH 0/4] sched: The newidle balance regression
Posted by Chris Mason 1 month, 1 week ago
On 11/7/25 11:06 AM, Peter Zijlstra wrote:
> Hi!
> 
> So most of you ran into Chris' commit 155213a2aed4 ("sched/fair: Bump
> sd->max_newidle_lb_cost when newidle balance fails") [*]
> 
> And I posted a patch with a few alternative options. And while I've heard back
> from a number of you, indicating that NI_TARGET (the effective revert) works
> for you. Not many tested TARGET+RANDOM (thanks Adam!).
> 
> In my limited schbench testing that combination isn't horrible, and per Adam
> that combination also doesn't suck for him. Chris, could you please see what
> this does for your machines with your actual workload?

Thanks Peter, I've got a big machine setup now and I'll get some numbers
this week.

-chris
Re: [PATCH 0/4] sched: The newidle balance regression
Posted by Josh Don 1 month, 1 week ago
Hey Peter,

On Fri, Nov 7, 2025 at 8:18 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> Hi!
>
> So most of you ran into Chris' commit 155213a2aed4 ("sched/fair: Bump
> sd->max_newidle_lb_cost when newidle balance fails") [*]
>
> And I posted a patch with a few alternative options. And while I've heard back
> from a number of you, indicating that NI_TARGET (the effective revert) works
> for you. Not many tested TARGET+RANDOM (thanks Adam!).
>
> In my limited schbench testing that combination isn't horrible, and per Adam
> that combination also doesn't suck for him. Chris, could you please see what
> this does for your machines with your actual workload?
>
> Anyway, here are a few patches that basically do the revert and introduce the
> proportional newidle balance -- the NI_TARGET+NI_RANDOM equivalent.
>
> Also at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/newidle
>
> Please all, give it a whirl. Hopefully I didn't wreck it, its Friday after all :-)
>
> [*] https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle.com

Initial signal from our originally failing tests shows that this new
series appears to fix the regression :)

I'll run some additional tests to get more coverage (unfortunately
these take quite a while to run).

Best,
Josh
Re: [PATCH 0/4] sched: The newidle balance regression
Posted by Chris Mason 1 month ago
On 11/7/25 11:06 AM, Peter Zijlstra wrote:
> Hi!
> 
> So most of you ran into Chris' commit 155213a2aed4 ("sched/fair: Bump
> sd->max_newidle_lb_cost when newidle balance fails") [*]
> 
> And I posted a patch with a few alternative options. And while I've heard back
> from a number of you, indicating that NI_TARGET (the effective revert) works
> for you. Not many tested TARGET+RANDOM (thanks Adam!).
> 
> In my limited schbench testing that combination isn't horrible, and per Adam
> that combination also doesn't suck for him. Chris, could you please see what
> this does for your machines with your actual workload?
> 
> Anyway, here are a few patches that basically do the revert and introduce the
> proportional newidle balance -- the NI_TARGET+NI_RANDOM equivalent.
> 
> Also at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/newidle
> 
> Please all, give it a whirl. Hopefully I didn't wreck it, its Friday after all :-)
> 
> [*] https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle.com 

This is working well for my original benchmark.  Focusing on newidle
balance schedstat counters (10 second interval):

Linus:
lb_balance_newly_idle              22854

Mason-revert:
lb_balance_newly_idle            2334059

Peter:
lb_balance_newly_idle              75271

The rest of the schbench numbers look good too.

Thanks everyone,
Chris
Re: [PATCH 0/4] sched: The newidle balance regression
Posted by Peter Zijlstra 1 month ago
On Wed, Nov 12, 2025 at 04:59:45PM -0500, Chris Mason wrote:
> On 11/7/25 11:06 AM, Peter Zijlstra wrote:
> > Hi!
> > 
> > So most of you ran into Chris' commit 155213a2aed4 ("sched/fair: Bump
> > sd->max_newidle_lb_cost when newidle balance fails") [*]
> > 
> > And I posted a patch with a few alternative options. And while I've heard back
> > from a number of you, indicating that NI_TARGET (the effective revert) works
> > for you. Not many tested TARGET+RANDOM (thanks Adam!).
> > 
> > In my limited schbench testing that combination isn't horrible, and per Adam
> > that combination also doesn't suck for him. Chris, could you please see what
> > this does for your machines with your actual workload?
> > 
> > Anyway, here are a few patches that basically do the revert and introduce the
> > proportional newidle balance -- the NI_TARGET+NI_RANDOM equivalent.
> > 
> > Also at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/newidle
> > 
> > Please all, give it a whirl. Hopefully I didn't wreck it, its Friday after all :-)
> > 
> > [*] https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle.com 
> 
> This is working well for my original benchmark.  Focusing on newidle
> balance schedstat counters (10 second interval):
> 
> Linus:
> lb_balance_newly_idle              22854
> 
> Mason-revert:
> lb_balance_newly_idle            2334059
> 
> Peter:
> lb_balance_newly_idle              75271
> 
> The rest of the schbench numbers look good too.

Sweet!