Re: [PATCH] sched/fair: Simplify continue_balancing for newidle

From: Ingo Molnar
Date: Tue Mar 26 2024 - 04:08:48 EST



* Shrikanth Hegde <sshegde@xxxxxxxxxxxxx> wrote:

> newidle(CPU_NEWLY_IDLE) balancing doesn't stop the load balancing if the
> continue_balancing flag is reset. Other two balancing (IDLE, BUSY) do
> that. newidle balance stops the load balancing if rq has a task or there
> is wakeup pending. The same checks are present in should_we_balance for
> newidle. Hence use the return value and simplify continue_balancing
> mechanism for newidle. Update the comment surrounding it as well.

Assuming there are no side-effects to balancing behavior.

> No change in functionality intended.

Is this actually true? Any change to behavior invalidates such a sentence.

> /*
> + * We must set idle_stamp _before_ calling sched_balance_rq()
> + * for CPU_NEWLY_IDLE, such that we measure the this duration
> + * as idle time.
> */

'the this' ...?

Thanks,

Ingo