Re: [Patch v4 17/22] sched/cache: Avoid cache-aware scheduling for memory-heavy processes
From: Peter Zijlstra
Date: Thu Apr 09 2026 - 08:57:40 EST
FWIW, I'm going to start auto-stripping *@gmail addresses soon. I'm
getting sick and tired of those bounces. If Google doesn't care, I can't
be arsed either.
On Thu, Apr 09, 2026 at 02:46:42PM +0200, Peter Zijlstra wrote:
> On Wed, Apr 01, 2026 at 02:52:29PM -0700, Tim Chen wrote:
> > From: Chen Yu <yu.c.chen@xxxxxxxxx>
> >
> > Prateek and Tingyin reported that memory-intensive workloads (such as
> > stream) can saturate memory bandwidth and caches on the preferred LLC
> > when sched_cache aggregates too many threads.
> >
> > To mitigate this, estimate a process's memory footprint by comparing
> > its RSS (anonymous and shared pages) to the size of the LLC. If RSS
> > exceeds the LLC size, skip cache-aware scheduling.
> >
> > Note that RSS is only an approximation of the memory footprint.
> > By default, the comparison is strict, but a later patch will allow
> > users to provide a hint to adjust this threshold.
> >
> > According to the test from Adam, some systems do not have shared L3
> > but with shared L2 as clusters. In this case, the L2 becomes the LLC[1].
>
> This is pretty terrible. If you want LLC size, add it to the topology
> information (and ideally integrate with RDT) and make proportional to
> cpumask size, such that if someone cuts the domain in pieces, they get
> proportional size etc.
>
> Also, if we have NUMA_BALANCING on, that can provide a much better
> estimate for the actual size.
>
> Just using RSS seems like a very bad metric here.
>