public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched_ext: idle: use active idle domain in WAKE_SYNC check
@ 2026-03-24 19:58 Joseph Salisbury
  2026-03-25 23:24 ` Andrea Righi
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Salisbury @ 2026-03-24 19:58 UTC (permalink / raw)
  To: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, sched-ext, linux-kernel

The WAKE_SYNC fast path checks whether there are idle CPUs before
biasing wakeups to the waker CPU.  After per-node idle masks were
introduced, this path started indexing idle_cpumask() with
cpu_to_node().

When per-node idle tracking is disabled, per-node masks are not kept in
sync and may be stale.  Reading them here can mis-detect system
utilization and lead to incorrect WAKE_SYNC wakeup placement.

Use scx_cpu_node_if_enabled() for the waker node lookup so this check
uses the global idle mask when per-node tracking is disabled and the
per-node mask only when that mode is enabled.

Fixes: 48849271e661 ("sched_ext: idle: Per-node idle cpumasks")
Cc: stable@vger.kernel.org # v6.15+
Assisted-by: Codex:GPT-5
Signed-off-by: Joseph Salisbury <joseph.salisbury@oracle.com>
---
 kernel/sched/ext_idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
index 8cfe0e9a7319..6b4520ed563d 100644
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -543,7 +543,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
 		 * piled up on it even if there is an idle core elsewhere on
 		 * the system.
 		 */
-		waker_node = cpu_to_node(cpu);
+		waker_node = scx_cpu_node_if_enabled(cpu);
 		if (!(current->flags & PF_EXITING) &&
 		    cpu_rq(cpu)->scx.local_dsq.nr == 0 &&
 		    (!(flags & SCX_PICK_IDLE_IN_NODE) || (waker_node == node)) &&
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-26 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 19:58 [PATCH] sched_ext: idle: use active idle domain in WAKE_SYNC check Joseph Salisbury
2026-03-25 23:24 ` Andrea Righi
2026-03-26 18:19   ` [External] : " Joseph Salisbury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox