Re: [PATCH v3 2/8] sched/topology: Allocate per-CPU sched_domain_shared in s_data

From: Chen, Yu C

Date: Wed Jan 21 2026 - 10:17:54 EST


On 1/20/2026 7:32 PM, K Prateek Nayak wrote:
The "sched_domain_shared" object is allocated for every topology level
in __sdt_alloc() and is freed post sched domain rebuild if they aren't
assigned during sd_init().

"sd->shared" is only assigned for SD_SHARE_LLC domains and out of all
the assigned objects, only "sd_llc_shared" is ever used by the
scheduler.

Since only "sd_llc_shared" is ever used, and since SD_SHARE_LLC domains
never overlap, allocate only a single range of per-CPU
"sched_domain_shared" object with s_data instead of doing it per
topology level.

The subsequent commit uses the degeneration path to correctly assign the
"sd->shared" to the topmost SD_SHARE_LLC domain.

No functional changes are expected at this point.


The sched_domain_shared is allocated in s_data and then
immediately released because per_cpu_ptr(d->sds, j) is
not NULL. I guess this is the reason why you mentioned
"No functional changes".

For the cluster domain that shares L2, I suppose we can bring
it back if there is a need in the future.

From my understanding,

Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>

thanks,
Chenyu