Re: [PATCH 6/24] make atomic_read() behave consistently on frv

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Tuesday, August 14, 2007 - 10:01 am

On Tue, Aug 14, 2007 at 03:34:25PM +1000, Nick Piggin wrote:

I prefer burying barriers into other primitives.


barrier() is useful, but it has the very painful side-effect of forcing
the compiler to dump temporaries.  So we do need something that is
not quite so global in effect.


There was something very similar discussed earlier in this thread,
with quite a bit of debate as to exactly what the "m" flag should
look like.  I suggested something similar named ACCESS_ONCE in the
context of RCU (http://lkml.org/lkml/2007/7/11/664):

	#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))

The nice thing about this is that it works for both loads and stores.
Not clear that order() above does this -- I get compiler errors when
I try something like "b = order(a)" or "order(a) = 1" using gcc 4.1.2.

						Thanx, Paul
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Paul E. McKenney, (Sun Aug 12, 11:03 pm)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Paul E. McKenney, (Tue Aug 14, 10:01 am)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Segher Boessenkool, (Wed Aug 15, 11:51 am)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Paul E. McKenney, (Wed Aug 15, 12:18 pm)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Segher Boessenkool, (Wed Aug 15, 12:46 pm)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Paul E. McKenney, (Wed Aug 15, 12:59 pm)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Segher Boessenkool, (Wed Aug 15, 1:13 pm)
Re: [PATCH 6/24] make atomic_read() behave consistently on frv, Segher Boessenkool, (Wed Aug 15, 2:15 pm)