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

From: Valentin Schneider

Date: Thu Feb 05 2026 - 11:53:21 EST


On 20/01/26 11:32, 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.
>
> Signed-off-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>

Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx>