Re: [PATCH 06/19] sched/fair: Assign preferred LLC ID to processes

From: Peter Zijlstra

Date: Wed Oct 15 2025 - 07:16:18 EST


On Tue, Oct 14, 2025 at 01:16:16PM +0800, Chen, Yu C wrote:

> The question becomes: how can we figure out the threads that share
> data? Can the kernel detect this, or get the hint from user space?

This needs the PMU, then you can steer using cache-miss ratios. But then
people will hate us for using counters.

> Yes, the numa_group in NUMA load balancing indicates
> that several tasks manipulate the same page, which could be an
> indicator. Besides, if task A frequently wakes up task B, does it
> mean A and B have the potential to share data? Furthermore, if
> task A wakes up B via a pipe, it might also indicate that A has
> something to share with B. I just wonder if we can introduce a
> structure to gather this information together.

The wakeup or pipe relation might be small relative to the working set.
Consider a sharded in memory database, where the query comes in through
the pipe/socket/wakeup. This query is small, but then it needs to go
trawl through its memory to find the answer.

Something we *could* look at -- later -- is an interface to create
thread groups, such that userspace that is clever enough can communicate
this. But then there is the ago old question, will there be sufficient
users to justify the maintenance of said interface.