Re: [PATCH v2 01/23] sched/cache: Introduce infrastructure for cache-aware load balancing

From: Tim Chen
Date: Tue Dec 16 2025 - 17:30:15 EST


On Thu, 2025-12-11 at 16:42 +0800, Vern Hao wrote:
>  
>
>
>
>
snip

> > + struct mm_sched __percpu *pcpu_sched;
> > + raw_spinlock_t mm_sched_lock;
> > + unsigned long mm_sched_epoch;
> > + int mm_sched_cpu;
> >  
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>  
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> As we discussed earlier,I continue to believe that dedicating 'mm_sched_cpu' to handle the aggregated hotspots of all threads is inappropriate, as the multiple threads lack a necessary correlation in our real application. 
>  
> So, I was wondering if we could put this variable into struct task_struct, That allows us to better monitor the hotspot CPU of each thread, despite some details needing consideration.
>  
>
>
Vern,
The stat is related to the group of threads(tasks) that we will like to group
together in an LLC. In current implementation, it is per process and hence
the placement in mm struct.

Later, we could change the grouping to other criteria (e.g. cgroup, or numa_group). In that
case the stats may be associated with other data struct that represent the
group. As I mentioned in the cover letter, that would be another exercise and we'll
like to get the basic grouping by process to be merged first before considering other
kinds of grouping.

Tim

>