Re: [PATCH 07/19] sched/fair: Track LLC-preferred tasks per runqueue
From: Tim Chen
Date: Wed Oct 15 2025 - 16:03:38 EST
On Wed, 2025-10-15 at 14:05 +0200, Peter Zijlstra wrote:
> On Sat, Oct 11, 2025 at 11:24:44AM -0700, Tim Chen wrote:
> > @@ -3999,6 +4038,7 @@ account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
> > struct rq *rq = rq_of(cfs_rq);
> >
> > account_numa_enqueue(rq, task_of(se));
> > + account_llc_enqueue(rq, task_of(se));
> > list_add(&se->group_node, &rq->cfs_tasks);
>
> Here and...
>
> > }
> > cfs_rq->nr_queued++;
> > @@ -4010,9 +4050,14 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
> > update_load_sub(&cfs_rq->load, se->load.weight);
> > if (entity_is_task(se)) {
> > account_numa_dequeue(rq_of(cfs_rq), task_of(se));
> > + account_llc_dequeue(rq_of(cfs_rq), task_of(se));
>
> ... here, could you please check the compiler is doing CSE of task_of()?
Will consolidate those task_of(se).
>
> > list_del_init(&se->group_node);
> > }
> > cfs_rq->nr_queued--;
> > +
> > + /* safeguard to clear the cache aware data */
> > + if (!parent_entity(se) && !cfs_rq->nr_queued)
> > + reset_llc_stats(rq_of(cfs_rq));
>
> I'm confused -- why?
Was put here in early code development to make
sure things would not go haywire. Will remove
them. Probably some warning of having tasks
preferring some LLC when there're no task in queue
is more appropriate.
Tim