Re: [PATCH v2 2/2] sched/cache: Drive cache task tick from execution context
From: Tim Chen
Date: Thu Sep 03 2026 - 13:59:18 EST
On Thu, 2026-09-03 at 12:11 +0800, Hui Su wrote:
>
[snip]
> void init_sched_mm(struct task_struct *p) { }
>
> -static void task_tick_cache(struct rq *rq, struct task_struct *p) { }
> +void task_tick_cache(struct rq *rq, struct task_struct *p) { }
>
> static inline int get_pref_llc(struct task_struct *p,
> struct mm_struct *mm)
> @@ -15042,8 +15042,6 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
> if (queued)
> return;
>
> - task_tick_cache(rq, curr);
> -
May be worth adding a comment here. Say you consolidate the
exec context stuff to a new sched_tick_exec_ctx() helper.
You can say something like the following here to help future
reader of this code.
+ /*
+ * Note: misfit, overutilized and core scheduling state describe the
+ * entity the load balancer would move, i.e. the scheduling context,
+ * and therefore stay with @curr rather than with rq->curr. See
+ * sched_tick_exec_ctx() for the execution context counterpart.
+ */
> update_misfit_status(curr, rq);
> check_update_overutilized_status(task_rq(curr));
Tim