[tip: sched/core] sched/fair: Have SD_SERIALIZE affect newidle balancing

tip-bot2 for Peter Zijlstra posted 1 patch 2 weeks ago
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[tip: sched/core] sched/fair: Have SD_SERIALIZE affect newidle balancing
Posted by tip-bot2 for Peter Zijlstra 2 weeks ago
The following commit has been merged into the sched/core branch of tip:

Commit-ID:     522fb20fbdbe48ed98f587d628637ff38ececd2d
Gitweb:        https://git.kernel.org/tip/522fb20fbdbe48ed98f587d628637ff38ececd2d
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Mon, 17 Nov 2025 17:13:09 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 17 Nov 2025 17:13:09 +01:00

sched/fair: Have SD_SERIALIZE affect newidle balancing

Also serialize the possiblty much more frequent newidle balancing for
the 'expensive' domains that have SD_BALANCE set.

Initial benchmarking by K Prateek and Tim showed no negative effect.

Split out from the larger patch moving sched_balance_running around
for ease of bisect and such.

Suggested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Seconded-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/df068896-82f9-458d-8fff-5a2f654e8ffd@amd.com
Link: https://patch.msgid.link/6fed119b723c71552943bfe5798c93851b30a361.1762800251.git.tim.c.chen@linux.intel.com

# Conflicts:
#	kernel/sched/fair.c
---
 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 59b17f0..071e07f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -11732,7 +11732,7 @@ redo:
 		goto out_balanced;
 	}
 
-	if (!need_unlock && (sd->flags & SD_SERIALIZE) && idle != CPU_NEWLY_IDLE) {
+	if (!need_unlock && (sd->flags & SD_SERIALIZE)) {
 		int zero = 0;
 		if (!atomic_try_cmpxchg_acquire(&sched_balance_running, &zero, 1))
 			goto out_balanced;