Skip to content

Commit ce29ddc

Browse files
compudjIngo Molnar
authored andcommitted
sched/membarrier: fix missing local execution of ipi_sync_rq_state()
The function sync_runqueues_membarrier_state() should copy the membarrier state from the @mm received as parameter to each runqueue currently running tasks using that mm. However, the use of smp_call_function_many() skips the current runqueue, which is unintended. Replace by a call to on_each_cpu_mask(). Fixes: 227a4aa ("sched/membarrier: Fix p->mm->membarrier_state racy load") Reported-by: Nadav Amit <[email protected]> Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: [email protected] # 5.4.x+ Link: https://lore.kernel.org/r/[email protected]
1 parent 50caf9c commit ce29ddc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kernel/sched/membarrier.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,7 @@ static int sync_runqueues_membarrier_state(struct mm_struct *mm)
471471
}
472472
rcu_read_unlock();
473473

474-
preempt_disable();
475-
smp_call_function_many(tmpmask, ipi_sync_rq_state, mm, 1);
476-
preempt_enable();
474+
on_each_cpu_mask(tmpmask, ipi_sync_rq_state, mm, true);
477475

478476
free_cpumask_var(tmpmask);
479477
cpus_read_unlock();

0 commit comments

Comments
 (0)