Commit 522fb20f authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

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: default avatarShrikanth Hegde <sshegde@linux.ibm.com>
Seconded-by: default avatarK Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: default avatarPeter 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
parent 3324b218
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11732,7 +11732,7 @@ static int sched_balance_rq(int this_cpu, struct rq *this_rq,
		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;