Re: [PATCH v4] sched/fair: Replace random newidle_balance with Bresenham accumulator
From: Qing Wang
Date: Fri Oct 30 2026 - 06:11:25 EST
On Fri, 30 Oct 2026 at 17:46, K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> On 10/30/2026 2:49 PM, Qing Wang wrote:
> > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> > index 919d0fb00bd9..79c477b47510 100644
> > --- a/kernel/sched/topology.c
> > +++ b/kernel/sched/topology.c
> > @@ -2002,6 +2002,7 @@ sd_init(struct sched_domain_topology_level *tl,
> > .newidle_call = 512,
> > .newidle_success = 256,
> > .newidle_ratio = 512,
> > + .newidle_window_pos = 0,
>
> nit.
>
> I think this value should start in a way that allows newidle balance to run at
> first attempt and then stabilize. Maybe '512; is a good number if not higher?
Thanks for the review.
The initial value of newidle_window_pos can be any value in [0, 1023];
it only affects when the first balance is allowed, not the spacing of
subsequent balances. I'm not sure which value is better here.
--
Best regards,
Qing