Skip to content

Commit

Permalink
cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun()
Browse files Browse the repository at this point in the history
The smp_mb() in cpuhp_thread_fun() is misplaced. It needs to be after the
load of st->should_run to prevent reordering of the later load/stores
w.r.t. the load of st->should_run.

Fixes: 4dddfb5 ("smp/hotplug: Rewrite AP state machine core")
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infraded.org>
Cc: josh@joshtriplett.org
Cc: peterz@infradead.org
Cc: jiangshanlai@gmail.com
Cc: dzickus@redhat.com
Cc: brendan.jackman@arm.com
Cc: malat@debian.org
Cc: mojha@codeaurora.org
Cc: sramana@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1536126727-11629-1-git-send-email-neeraju@codeaurora.org
  • Loading branch information
Neeraj Upadhyay authored and Thomas Gleixner committed Sep 6, 2018
1 parent 60c1f89 commit f8b7530
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,15 @@ static void cpuhp_thread_fun(unsigned int cpu)
bool bringup = st->bringup;
enum cpuhp_state state;

if (WARN_ON_ONCE(!st->should_run))
return;

/*
* ACQUIRE for the cpuhp_should_run() load of ->should_run. Ensures
* that if we see ->should_run we also see the rest of the state.
*/
smp_mb();

if (WARN_ON_ONCE(!st->should_run))
return;

cpuhp_lock_acquire(bringup);

if (st->single) {
Expand Down

0 comments on commit f8b7530

Please sign in to comment.