From: Andi Kleen <andi@firstfloor.org>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, dipankar@in.ibm.com,
josht@linux.vnet.ibm.com, akpm@linux-foundation.org
Subject: Re: [PATCH] Immunize rcu_dereference() against crazy compiler writers
Date: 12 Jul 2007 16:03:19 +0200 [thread overview]
Message-ID: <p73hco9yb14.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070712010058.GA30869@linux.vnet.ibm.com>
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> writes:
> Turns out that compiler writers are a bit more aggressive about optimizing
> than one might expect. This patch prevents a number of such optimizations
> from messing up rcu_deference(). This is not merely a theoretical
> problem, as evidenced by the rmb() in mce_log().
Don't think that's an improvement. rmb() at least is known to work
reliable to prevent such reordering. Memory barriers are well
documented in the gcc documentation. Who knows about volatile? The
volatile semantics have been traditionally unclear and shakey.
The C standard doesn't make much guarantees and i don't think
gcc does either.
If anything you might want to embedd rmb(); in a statement expression
in rcu_deference instead.
-Andi
next prev parent reply other threads:[~2007-07-12 13:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-12 1:00 [PATCH] Immunize rcu_dereference() against crazy compiler writers Paul E. McKenney
2007-07-12 1:03 ` [PATCH] Remove workaround for unimmunized rcu_dereference from mce_log() Paul E. McKenney
2007-07-12 14:03 ` Andi Kleen [this message]
2007-07-12 14:49 ` [PATCH] Immunize rcu_dereference() against crazy compiler writers Paul E. McKenney
2007-07-12 16:08 ` Josh Triplett
2007-07-17 9:46 ` Andrew Morton
2007-07-17 13:53 ` Paul E. McKenney
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=p73hco9yb14.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=dipankar@in.ibm.com \
--cc=josht@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.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