Re: [Patch v4 13/16] sched/cache: Fix cache aware scheduling enabling for multi LLCs system
From: Peter Zijlstra
Date: Mon May 18 2026 - 11:24:40 EST
On Wed, May 13, 2026 at 01:39:24PM -0700, Tim Chen wrote:
> From: Chen Yu <yu.c.chen@xxxxxxxxx>
>
> If there are multiple LLCs in the system, cache aware scheduling
> should be enabled. However, there is a corner case where, if there
> is a single NUMA node and a single LLC per node, cache aware
> scheduling will be turned on in the current implementation -
> because at this moment, the parent domain has not yet been
> degenerated, and it is possible that the current domain has the
> same cpu span as its parent. There is no need to turn cache aware
> scheduling on in this scenario.
>
> Fix it by iterating the parent domains to find a domain that is
> a superset of the current sd_llc, so that later, after the duplicated
> parent domains have been degenerated, cache aware scheduling will
> take effect.
>
> For example, the expected behavior would be:
> 2 sockets, 1 LLC per socket: MC span=0-3, PKG span=0-7, has_multi_llcs=true
> 1 socket, 2 LLCs per socket: MC span=0-3, PKG span=0-7, has_multi_llcs=true
> 2 sockets, 2 LLCs per socket: MC span=0-3, PKG span=0-7, has_multi_llcs=true
> 1 socket, 1 LLC per socket: MC span=0-3, PKG span=0-3, has_multi_llcs=false
>
> This bug was reported by sashiko.
>
> Fixes: d59f4fd1d303 ("sched/cache: Enable cache aware scheduling for
> multi LLCs NUMA node")
FWIW, this and the next patch have this Fixes: line mangled -- I fixed
it. But please figure out what did that so it doesn't happen again.