sched/fair: Simplify the continue_balancing logic in sched_balance_newidle()
authorShrikanth Hegde <sshegde@linux.ibm.com>
Mon, 25 Mar 2024 15:39:26 +0000 (21:09 +0530)
committerIngo Molnar <mingo@kernel.org>
Tue, 26 Mar 2024 19:16:20 +0000 (20:16 +0100)
commitc829d6818b60c591f70c060b2bb75d76cf0cec6d
tree617577782cf93538d43bad17484b37e7f82c5420
parentd0f5d3cefc259f498456338d319098dc84393b24
sched/fair: Simplify the continue_balancing logic in sched_balance_newidle()

newidle(CPU_NEWLY_IDLE) balancing doesn't stop the load-balancing if the
continue_balancing flag is reset, but the other two balancing (IDLE, BUSY)
cases 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.

No change in functionality intended.

Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lore.kernel.org/r/20240325153926.274284-1-sshegde@linux.ibm.com
kernel/sched/fair.c