Subject: Re: [BUG] sched/cache: "Make LLC id continuous" causes NULL cpumask dereference in build_sched_domains on POWER9

From: Srikar Dronamraju <[email-masked]>
Date: Thu, 28 May 2026 22:14:53 +0530

* Shrikanth Hegde <[email-masked]> [2026-05-28 22:01:53]:

> > > index 3467f86fd78f..cc8e87d6cae9 100644
> > > --- a/arch/powerpc/kernel/smp.c
> > > +++ b/arch/powerpc/kernel/smp.c
> > > @@ -1101,6 +1101,16 @@ const struct cpumask *cpu_die_mask(int cpu)
> > >   }
> > >   EXPORT_SYMBOL_GPL(cpu_die_mask);
> > > +const struct cpumask *arch_llc_mask(int cpu)
> > > +{
> > > +	/* Power9, CACHE domain is the LLC*/
> > > +	if (shared_caches)
> > > +		return cpu_l2_cache_mask(cpu);
> > > +
> > > +	/* For others, SMT domain is the LLC*/
> > > +	return cpu_smt_mask(cpu);
> > > +}
> > 
> > Why dont we do
> > #define arch_llc_mask cpu_l2_cache_mask
> > 
> 
> I would prefer to keep the abstraction. This leaves
> room for implementation details.
> 

We could always do that whenever we need it.
But doing it now will confuse the reader. Why keep if and else when both are
returning the same.

-- 
Thanks and Regards
Srikar Dronamraju