lkml.org 
[lkml]   [2016]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -tip] x86/mce: Use atomic_inc_return barrier when starting monad sync
Date
mce_start() has an explicit smp_wmb to serialize writes to
global_nwo and mce_callin. However, atomic_inc_return() implies
barriers on both sides of the call, as such simply rely on this
full smp barrier.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
arch/x86/kernel/cpu/mcheck/mce.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index f0c921b03e42..6b7039c166b8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -830,9 +830,9 @@ static int mce_start(int *no_way_out)

atomic_add(*no_way_out, &global_nwo);
/*
- * global_nwo should be updated before mce_callin
+ * Rely on the implied barrier below, such that global_nwo
+ * is updated before mce_callin.
*/
- smp_wmb();
order = atomic_inc_return(&mce_callin);

/*
--
2.1.4
\
 
 \ /
  Last update: 2016-03-22 01:01    [W:0.225 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site