From: Linus Torvalds <torvalds@osdl.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] remove volatile from nmi.c
Date: Fri, 14 Jul 2006 10:28:26 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0607141017520.5623@g5.osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0607140757080.5623@g5.osdl.org>
On Fri, 14 Jul 2006, Linus Torvalds wrote:
>
> Now, there is a "reason" we'd want "endflag" to either be volatile, or
> have the "set_wmb()", and that is that the code is incorrect in the first
> place.
Btw, and this may just be me, but I personally don't much like the
"set_wmb()" macro. I think it should be removed.
I don't think we actually use it anywhere, and the thing is, it's not
really useful. It is basically _always_ equivalent to
var = value;
smp_wmb();
except I think some architectures could _in_theory_ make the assignment be
a "store with release consistency". The only architecture where that might
make sense that I can think of is Itanium, and even there the ia64
set_wmb() macro doesn't actually do that.
Yeah, the
endflag = 1;
smp_wmb();
is a bit longer, but is actually easier to understand, I think.
I suspect "set_wmb()" was added just from an incorrect sense of
consistency with "set_mb()" (which I don't particularly like either, but
at least that one makes a difference on a real platform, ie on x86 that
"set_mb()" ends up being implemented as a single "xchg" instruction).
Linus
next prev parent reply other threads:[~2006-07-14 17:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-14 13:04 [PATCH] remove volatile from nmi.c Steven Rostedt
2006-07-14 13:28 ` Nick Piggin
2006-07-14 15:23 ` Linus Torvalds
2006-07-14 16:32 ` Chase Venters
2006-07-14 16:47 ` Linus Torvalds
2006-07-14 17:00 ` Steven Rostedt
2006-07-14 17:28 ` Linus Torvalds [this message]
2006-07-14 17:38 ` Steven Rostedt
2006-07-14 17:41 ` Linus Torvalds
2006-07-14 17:58 ` Andrew Morton
2006-07-14 20:04 ` [PATCH 00/02] remove set_wmb Steven Rostedt
2006-07-14 20:05 ` [PATCH 01/02] remove set_wmb - doc update Steven Rostedt
2006-07-15 2:22 ` Matthew Wilcox
2006-07-15 2:35 ` Steven Rostedt
2006-07-14 20:05 ` [PATCH 02/02] remove set_wmb - arch removal Steven Rostedt
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=Pine.LNX.4.64.0607141017520.5623@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
/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.