Re: [RFC PATCH 1/2] Fix: sched/membarrier: p->mm->membarrier_state racy load

Linus Torvalds
2019-09-03T20:27:44Z

On Tue, Sep 3, 2019 at 1:11 PM Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> + cpus_read_lock();
> + for_each_online_cpu(cpu) {

This would likely be better off using mm_cpumask(mm) instead of all
online CPU's.

Plus doing the rcu_read_lock() inside the loop seems pointless. Even
with a lot of cores, it's not going to loop _that_ many times for RCU
latency to be an issue.

Linus