From: Alexander Fyodorov <halcy@yandex.ru>
To: Waiman Long <waiman.long@hp.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
"Chandramouleeswaran, Aswin" <aswin@hp.com>,
"Norton, Scott J" <scott.norton@hp.com>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH RFC v2 1/2] qspinlock: Introducing a 4-byte queue spinlock implementation
Date: Thu, 29 Aug 2013 21:03:20 +0400 [thread overview]
Message-ID: <53161377795800@web14m.yandex.ru> (raw)
In-Reply-To: <521F67C9.4080805@hp.com>
29.08.2013, 19:25, "Waiman Long" <waiman.long@hp.com>:
> What I have been thinking is to set a flag in an architecture specific
> header file to tell if the architecture need a memory barrier. The
> generic code will then either do a smp_mb() or barrier() depending on
> the presence or absence of the flag. I would prefer to do more in the
> generic code, if possible.
If you use flag then you'll have to check it manually. It is better to add new smp_mb variant, I suggest calling it smp_mb_before_store(), and define it to barrier() on x86.
But the same constraints as to UNLOCK_LOCK_PREFIX should apply here, so it will be something like this:
arch/x86/include/asm/barrier.h:
+#if defined(CONFIG_X86_32) && \
+ (defined(CONFIG_X86_OOSTORE) || defined+(CONFIG_X86_PPRO_FENCE))
+/*
+ * On PPro SMP or if we are using OOSTORE, we use a full memory barrier
+ * (PPro errata 66, 92)
+ */
+# define smp_mb_before_store() smp_mb()
+#else
+# define smp_mb_before_store() barrier()
+#endif
next prev parent reply other threads:[~2013-08-29 17:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <15321377012704@web8h.yandex.ru>
2013-08-21 3:01 ` [PATCH RFC v2 1/2] qspinlock: Introducing a 4-byte queue spinlock implementation Waiman Long
2013-08-21 15:51 ` Alexander Fyodorov
2013-08-22 1:04 ` Waiman Long
2013-08-22 13:28 ` Alexander Fyodorov
2013-08-26 20:14 ` Waiman Long
2013-08-27 12:09 ` Alexander Fyodorov
[not found] ` <20130827091436.3d5971a0@gandalf.local.home>
2013-08-27 13:53 ` Peter Zijlstra
2013-08-28 1:21 ` Paul E. McKenney
2013-08-28 8:19 ` Peter Zijlstra
2013-08-28 12:59 ` Steven Rostedt
2013-08-28 13:05 ` Peter Zijlstra
2013-08-28 13:15 ` Steven Rostedt
2013-08-28 13:37 ` Peter Zijlstra
2013-08-29 15:24 ` Waiman Long
2013-08-29 17:03 ` Alexander Fyodorov [this message]
2013-08-30 3:16 ` Waiman Long
2013-08-30 8:15 ` Alexander Fyodorov
2013-08-13 18:41 [PATCH RFC v2 0/2] qspinlock: Introducing a 4-byte queue spinlock Waiman Long
2013-08-13 18:41 ` [PATCH RFC v2 1/2] qspinlock: Introducing a 4-byte queue spinlock implementation Waiman Long
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=53161377795800@web14m.yandex.ru \
--to=halcy@yandex.ru \
--cc=aswin@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=scott.norton@hp.com \
--cc=tglx@linutronix.de \
--cc=waiman.long@hp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox