All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Xiaowei" <xiaowei.yang@intel.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: [PATCH] Fix memory order issue inside pv spinlock
Date: Mon, 07 Sep 2009 15:40:47 +0800	[thread overview]
Message-ID: <4AA4B8FF.9070905@intel.com> (raw)

barrier() can't prevent reads after it not being reordered with older writes to 
different locates before it. Because of it, I can't bring up > 4 HVM guests on 
one SMP machine. Use mb() instead.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>

diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index 5601506..9dee5f8 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -324,7 +325,7 @@ static void xen_spin_unlock(struct raw_spinlock *lock)
         xl->lock = 0;           /* release lock */

         /* make sure unlock happens before kick */
-       barrier();
+       mb();

         if (unlikely(xl->spinners))
                 xen_spin_unlock_slow(xl);

Thanks,
Xiaowei

             reply	other threads:[~2009-09-07  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-07  7:40 Yang, Xiaowei [this message]
2009-09-08 21:59 ` [PATCH] Fix memory order issue inside pv spinlock Jeremy Fitzhardinge
2009-09-09 16:30   ` Yang, Xiaowei
2009-09-09 19:02     ` Jeremy Fitzhardinge
2009-09-10  1:41       ` Yang, Xiaowei
2009-09-10  1:50         ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA4B8FF.9070905@intel.com \
    --to=xiaowei.yang@intel.com \
    --cc=jeremy@goop.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.