All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: Do not pull when the local CPU is the only overloaded one
@ 2026-08-07 15:07 Liang Hao
  0 siblings, 0 replies; only message in thread
From: Liang Hao @ 2026-08-07 15:07 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Luca Abeni,
	Daniel Bristot de Oliveira
  Cc: Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak, linux-kernel,
	Liang Hao

Mirror the short-circuit added to pull_rt_task() by commit f73c52a5bcd1
("sched/rt: Do not pull from current CPU if only one CPU to pull"):
when dlo_count == 1 and the local CPU owns the sole dlo_mask bit, the
for_each_cpu() loop skips this_cpu on every iteration and does nothing.
Return early instead.

pull_dl_task() shares the same overload-tracking design as the RT side
-- dl_set_overload() mirrors rt_set_overload(), incrementing rd->dlo_count
after an smp_wmb() that pairs with the smp_rmb() in the pull path -- but
never got the matching check.  DEADLINE has no RT_PUSH_IPI path, so this
is the symmetric short-circuit only.

No functional change.

Signed-off-by: Liang Hao <haohlliang@gmail.com>
---
 kernel/sched/deadline.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 857dbe3519a8..c3e38d4f3365 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -3222,8 +3222,9 @@ static void pull_dl_task(struct rq *this_rq)
 	bool resched = false;
 	struct rq *src_rq;
 	u64 dmin = LONG_MAX;
+	int dl_overload_count = dl_overloaded(this_rq);
 
-	if (likely(!dl_overloaded(this_rq)))
+	if (likely(!dl_overload_count))
 		return;
 
 	/*
@@ -3232,6 +3233,11 @@ static void pull_dl_task(struct rq *this_rq)
 	 */
 	smp_rmb();
 
+	/* If we are the only overloaded CPU do nothing */
+	if (dl_overload_count == 1 &&
+	    cpumask_test_cpu(this_rq->cpu, this_rq->rd->dlo_mask))
+		return;
+
 	for_each_cpu(cpu, this_rq->rd->dlo_mask) {
 		if (this_cpu == cpu)
 			continue;
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 15:07 [PATCH] sched/deadline: Do not pull when the local CPU is the only overloaded one Liang Hao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.