[PATCH v5 1/4] smpboot: introduce SDTL_INIT() helper to tidy sched topology setup
Peter Zijlstra
peterz at infradead.org
Fri Jul 11 23:06:01 AEST 2025
On Fri, Jul 11, 2025 at 11:20:30AM +0530, K Prateek Nayak wrote:
> On 7/10/2025 4:27 PM, Li Chen wrote:
> > /*
> > * .. and append 'j' levels of NUMA goodness.
> > */
> > for (j = 1; j < nr_levels; i++, j++) {
> > - tl[i] = (struct sched_domain_topology_level){
> > - .mask = sd_numa_mask,
> > - .sd_flags = cpu_numa_flags,
> > - .flags = SDTL_OVERLAP,
> > - .numa_level = j,
> > - SD_INIT_NAME(NUMA)
> > - };
> > + tl[i] = SDTL_INIT(sd_numa_mask, cpu_numa_flags, NUMA);
> > + tl[i].numa_level = j;
> > + tl[i].flags = SDTL_OVERLAP;
>
> Tangential discussion: I was looking at this and was wondering why we
> need a "tl->flags" when there is already sd_flags() function and we can
> simply add SD_OVERLAP to sd_numa_flags().
>
> I think "tl->flags" was needed when the idea of overlap domains was
> added in commit e3589f6c81e4 ("sched: Allow for overlapping sched_domain
> spans") when it depended on "FORCE_SD_OVERLAP" sched_feat() which
> allowed toggling this off but that was done away with in commit
> af85596c74de ("sched/topology: Remove FORCE_SD_OVERLAP") so perhaps we
> can get rid of it now?
>
> Relying on SD_NUMA should be enough currently. Peter, Valentin, what do
> you think of something like below?
I think you're right. SD_NUMA appears to be the one and only case that
also has SDTL_OVERLAP which then results in setting SD_OVERLAP, making
SD_NUMA and SD_OVERLAP equivalent and SDTL_OVERLAP redundant.
I'll presume you're okay with me adding your SoB to things, and I'll
push out all 5 patches to queue/sched/core to let the robots have a go
at things.
More information about the Linuxppc-dev
mailing list