Re: [PATCH] sched/topology: Assert non-NUMA topology masks don't (partially) overlap

From: Peter Zijlstra
Date: Thu Jan 16 2020 - 10:19:50 EST


On Thu, Jan 16, 2020 at 11:44:28AM +0100, Peter Zijlstra wrote:
> On Wed, Jan 15, 2020 at 04:09:15PM +0000, Valentin Schneider wrote:
> > @@ -1975,6 +2011,9 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
> > has_asym = true;
> > }
> >
> > + if (WARN_ON(!topology_span_sane(tl, cpu_map, i)))
> > + goto error;
> > +
> > sd = build_sched_domain(tl, cpu_map, attr, sd, dflags, i);
> >
> > if (tl == sched_domain_topology)
>
> This is O(nr_cpus), but then, that function already is, so I don't see a
> problem with this.

Clearly I meant to write O(nr_cpus^2), there's a bunch of nested
for_each_cpu() in there.

> I'll take it, thanks!