Re: [PATCH] sched,topology: Update sched topology atomically
From: Valentin Schneider
Date: Mon Apr 11 2022 - 04:22:32 EST
On 08/04/22 17:52, Valentin Schneider wrote:
>> + topology = rcu_dereference(sched_numa_topology);
>> + for (i = 0; i < topology->nr_levels; i++) {
>> + if (!topology->masks[i][j])
>
> If I got default_numa_topology right and it's meant to be static,
> sched_numa_topology->masks can still be NULL, but here this would be gated
> by nr_levels being 0... Did I get that right?
>
Being a file-global variable, that's already init'd-as-0, (I'll use
my longish break as an excuse for forgetting that one), but the rest still
applies.
>> break;
>> - cpu = cpumask_any_and(cpus, masks[i][j]);
>> + cpu = cpumask_any_and(cpus, topology->masks[i][j]);
>> if (cpu < nr_cpu_ids) {
>> found = cpu;
>> break;
>> }
>> }
>> -unlock:
>> rcu_read_unlock();
>>
>> return found;
>> --
>> 2.30.2