smp_call_function_many requires disabling preemption around the call.
Signed-off-by: Mathieu Desnoyers mathieu.desnoyers@efficios.com CC: Linus Torvalds torvalds@linux-foundation.org CC: Peter Zijlstra peterz@infradead.org CC: Paul E. McKenney paulmck@linux.vnet.ibm.com CC: Boqun Feng boqun.feng@gmail.com CC: Andrew Hunter ahh@google.com CC: Maged Michael maged.michael@gmail.com CC: Avi Kivity avi@scylladb.com CC: Benjamin Herrenschmidt benh@kernel.crashing.org CC: Paul Mackerras paulus@samba.org CC: Michael Ellerman mpe@ellerman.id.au CC: Dave Watson davejwatson@fb.com CC: Thomas Gleixner tglx@linutronix.de CC: Ingo Molnar mingo@redhat.com CC: "H. Peter Anvin" hpa@zytor.com CC: Andrea Parri parri.andrea@gmail.com CC: stable@vger.kernel.org # v4.14 --- kernel/sched/membarrier.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index dd7908743dab..9bcbacba82a8 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -89,7 +89,9 @@ static int membarrier_private_expedited(void) rcu_read_unlock(); } if (!fallback) { + preempt_disable(); smp_call_function_many(tmpmask, ipi_mb, NULL, 1); + preempt_enable(); free_cpumask_var(tmpmask); } cpus_read_unlock();
Hi Linus, Peter, Ingo,
Now that membarrier.c has been moved from kernel/ to kernel/sched/, should I route this membarrier fix through the scheduler maintainers, or is it OK to send it to you directly ?
Thanks,
Mathieu
----- On Dec 15, 2017, at 2:23 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
smp_call_function_many requires disabling preemption around the call.
Signed-off-by: Mathieu Desnoyers mathieu.desnoyers@efficios.com CC: Linus Torvalds torvalds@linux-foundation.org CC: Peter Zijlstra peterz@infradead.org CC: Paul E. McKenney paulmck@linux.vnet.ibm.com CC: Boqun Feng boqun.feng@gmail.com CC: Andrew Hunter ahh@google.com CC: Maged Michael maged.michael@gmail.com CC: Avi Kivity avi@scylladb.com CC: Benjamin Herrenschmidt benh@kernel.crashing.org CC: Paul Mackerras paulus@samba.org CC: Michael Ellerman mpe@ellerman.id.au CC: Dave Watson davejwatson@fb.com CC: Thomas Gleixner tglx@linutronix.de CC: Ingo Molnar mingo@redhat.com CC: "H. Peter Anvin" hpa@zytor.com CC: Andrea Parri parri.andrea@gmail.com CC: stable@vger.kernel.org # v4.14
kernel/sched/membarrier.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index dd7908743dab..9bcbacba82a8 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -89,7 +89,9 @@ static int membarrier_private_expedited(void) rcu_read_unlock(); } if (!fallback) {
smp_call_function_many(tmpmask, ipi_mb, NULL, 1);preempt_disable();
free_cpumask_var(tmpmask); } cpus_read_unlock();preempt_enable();
-- 2.11.0
Hi Linus,
Can you pick up this straightforward fix please ? Let me know whether I need to re-send the patch if for some reason the original post is too far back in your inbox.
Thanks,
Mathieu
----- On Dec 20, 2017, at 10:02 AM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
Hi Linus, Peter, Ingo,
Now that membarrier.c has been moved from kernel/ to kernel/sched/, should I route this membarrier fix through the scheduler maintainers, or is it OK to send it to you directly ?
Thanks,
Mathieu
----- On Dec 15, 2017, at 2:23 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
smp_call_function_many requires disabling preemption around the call.
Signed-off-by: Mathieu Desnoyers mathieu.desnoyers@efficios.com CC: Linus Torvalds torvalds@linux-foundation.org CC: Peter Zijlstra peterz@infradead.org CC: Paul E. McKenney paulmck@linux.vnet.ibm.com CC: Boqun Feng boqun.feng@gmail.com CC: Andrew Hunter ahh@google.com CC: Maged Michael maged.michael@gmail.com CC: Avi Kivity avi@scylladb.com CC: Benjamin Herrenschmidt benh@kernel.crashing.org CC: Paul Mackerras paulus@samba.org CC: Michael Ellerman mpe@ellerman.id.au CC: Dave Watson davejwatson@fb.com CC: Thomas Gleixner tglx@linutronix.de CC: Ingo Molnar mingo@redhat.com CC: "H. Peter Anvin" hpa@zytor.com CC: Andrea Parri parri.andrea@gmail.com CC: stable@vger.kernel.org # v4.14
kernel/sched/membarrier.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index dd7908743dab..9bcbacba82a8 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -89,7 +89,9 @@ static int membarrier_private_expedited(void) rcu_read_unlock(); } if (!fallback) {
smp_call_function_many(tmpmask, ipi_mb, NULL, 1);preempt_disable();
free_cpumask_var(tmpmask); } cpus_read_unlock();preempt_enable();
-- 2.11.0
-- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
* Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
Hi Linus,
Can you pick up this straightforward fix please ? Let me know whether I need to re-send the patch if for some reason the original post is too far back in your inbox.
The fix looks much more reasonable than previous attempts: I'll pick it up into tip:sched/urgent and send it Linuswards.
Thanks,
Ingo
linux-stable-mirror@lists.linaro.org