lkml.org 
[lkml]   [2007]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Immunize rcu_dereference() against crazy compiler writers
From
Date
"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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-12 15:11    [W:0.051 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site