[PATCH 2/2] sched/cache: Use execution context for cache task tick
From: Hui Su
Date: Wed Sep 02 2026 - 13:25:19 EST
Cache-aware scheduling accounts CPU runtime to the mm of the task
actually executing. update_se() passes rq->curr to account_mm_sched()
for this purpose.
With proxy execution, however, fair_sched_class::task_tick() receives
rq->donor as its task argument. Passing that argument to task_tick_cache()
can therefore queue cache_work and update the cache scan epoch for the
donor's mm even though the corresponding CPU runtime is accounted to the
execution context's mm.
Use rq->curr for task_tick_cache() so cache scan work is driven for the
same execution context whose runtime is accounted by account_mm_sched().
Fixes: df0d98475954 ("sched/cache: Introduce infrastructure for cache-aware load balancing")
Signed-off-by: Hui Su <sh_def@xxxxxxx>
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 09ddb3802c28..866f2a5dd101 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -15045,7 +15045,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
if (static_branch_unlikely(&sched_numa_balancing))
task_tick_numa(rq, rq->curr);
- task_tick_cache(rq, curr);
+ task_tick_cache(rq, rq->curr);
update_misfit_status(curr, rq);
check_update_overutilized_status(task_rq(curr));
--
2.54.0