Re: [PATCH v2 06/23] sched/cache: Track LLC-preferred tasks per runqueue
From: Chen, Yu C
Date: Mon Dec 15 2025 - 19:20:56 EST
On 12/10/2025 5:42 PM, Peter Zijlstra wrote:
On Tue, Dec 09, 2025 at 02:55:21PM -0800, Tim Chen wrote:
+static void account_llc_dequeue(struct rq *rq, struct task_struct *p)
+{
+ int pref_llc;
+
+ /*
+ * Borrow the uc_se->active from uclamp_rq_inc_id(),
+ * uclamp_rq_dec_id() to avoid the unbalanced calculation
+ * of rq statistics.
+ */
+ if (unlikely(!p->sched_llc_active))
+ return;
Another very confusing comment; what? Also, can you please explain (in
the new comment) how we get here without having llc_active set?
The comment meant to say that we are using a similar mechanism as
accounting done in uc_se->active from uclamp_rq_inc_id(). I agree that
it confuses more than making things clearer.
How about the following comment to make things clearer:
/*
* Cache aware scheduling was active when the task was enqueued.
* Admin has disabled cache aware scheduling before task was dequeued
* but the accounting has to be kept straight in case cache aware scheduling
* is re-enabled.
*/
Is having that sched_cache_enabled() test worth it?
account_numa_{en,de}queue() don't seem to have any of this.
OK, I think we can remove the sched_cache_enabled() check and
make the account_llc_{en,de}queue() depending on CONFIG_SCHED_CACHE,
so the sched_llc_active can be removed.
thanks,
Chenyu