mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -tip] locking/pvqspinlock: replace xchg() by the more descriptive set_mb()
@ 2015-05-11  1:17 Waiman Long
  0 siblings, 0 replies; only message in thread
From: Waiman Long @ 2015-05-11  1:17 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: linux-kernel, Linus Torvalds, Scott J Norton, Douglas Hatch, Waiman Long

The xchg() function was used in pv_wait_node() to set a certain value
and provide a memory barrier which is what the set_mb() function
is for.  This patch replaces the xchg() call by set_mb().

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 kernel/locking/qspinlock_paravirt.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h
index b5758a9..27ab96d 100644
--- a/kernel/locking/qspinlock_paravirt.h
+++ b/kernel/locking/qspinlock_paravirt.h
@@ -175,7 +175,7 @@ static void pv_wait_node(struct mcs_spinlock *node)
 		 *
 		 * Matches the xchg() from pv_kick_node().
 		 */
-		(void)xchg(&pn->state, vcpu_halted);
+		set_mb(pn->state, vcpu_halted);
 
 		if (!READ_ONCE(node->locked))
 			pv_wait(&pn->state, vcpu_halted);
-- 
1.7.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-11  1:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11  1:17 [PATCH -tip] locking/pvqspinlock: replace xchg() by the more descriptive set_mb() Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®