lkml.org 
[lkml]   [2019]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC][PATCH 02/13] stop_machine: Fix stop_cpus_in_progress ordering
Make sure the entire for loop has stop_cpus_in_progress set.

Cc: Valentin Schneider <valentin.schneider@arm.com>
Cc: Aaron Lu <aaron.lwe@gmail.com>
Cc: keescook@chromium.org
Cc: mingo@kernel.org
Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Phil Auld <pauld@redhat.com>
Cc: torvalds@linux-foundation.org
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: fweisbec@gmail.com
Cc: subhra.mazumdar@oracle.com
Cc: tglx@linutronix.de
Cc: Julien Desfossez <jdesfossez@digitalocean.com>
Cc: pjt@google.com
Cc: Nishanth Aravamudan <naravamudan@digitalocean.com>
Cc: Aubrey Li <aubrey.intel@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: kerrnel@google.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/0fd8fd4b99b9b9aa88d8b2dff897f7fd0d88f72c.1559129225.git.vpillai@digitalocean.com
---
kernel/stop_machine.c | 2 ++
1 file changed, 2 insertions(+)

--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -383,6 +383,7 @@ static bool queue_stop_cpus_work(const s
*/
preempt_disable();
stop_cpus_in_progress = true;
+ barrier();
for_each_cpu(cpu, cpumask) {
work = &per_cpu(cpu_stopper.stop_work, cpu);
work->fn = fn;
@@ -391,6 +392,7 @@ static bool queue_stop_cpus_work(const s
if (cpu_stop_queue_work(cpu, work))
queued = true;
}
+ barrier();
stop_cpus_in_progress = false;
preempt_enable();


\
 
 \ /
  Last update: 2019-07-26 18:21    [W:0.229 / U:1.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site