[PATCH 1/2] sched/numa: Use execution context for NUMA task tick

From: Hui Su

Date: Wed Sep 02 2026 - 13:12:03 EST


With proxy execution, fair_sched_class::task_tick() receives the
scheduling context in rq->donor, while rq->curr identifies the task
that is actually executing.

NUMA tick handling is tied to the execution context. In particular,
task_tick_numa() uses the task's sum_exec_runtime to drive periodic
scans and queues numa_work against that task and its mm.

Proxy execution runtime accounting deliberately charges sum_exec_runtime
to rq->curr rather than rq->donor. Passing the donor to task_tick_numa()
therefore drives NUMA scanning from a task whose runtime is not being
advanced by proxy execution, while the executing task's NUMA state is
not driven by the tick.

Use rq->curr when invoking task_tick_numa() so the runtime, mm and
task_work all belong to the execution context.

Fixes: af0c8b2bf67b ("sched: Split scheduler and execution contexts")
Signed-off-by: Hui Su <sh_def@xxxxxxx>

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8dff37059faf..09ddb3802c28 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -15043,7 +15043,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
return;

if (static_branch_unlikely(&sched_numa_balancing))
- task_tick_numa(rq, curr);
+ task_tick_numa(rq, rq->curr);

task_tick_cache(rq, curr);

--
2.54.0