Re: [PATCH 1/24] make atomic_read() behave consistently on alpha

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Thursday, August 9, 2007 - 7:32 am

On Thu, Aug 09, 2007 at 09:24:42AM -0400, Chris Snook wrote:

Why not the same access-once semantics for atomic_set() as
for atomic_read()?  As this patch stands, it might introduce
architecture-specific compiler-induced bugs due to the fact that
atomic_set() used to imply volatile behavior but no longer does.

See below for one approach to fixing this.


How about:

#define atomic_set(v,i)		((*(volatile int *)&(v)->counter) = (i))
#define atomic64_set(v,i)	((*(volatile long *)&(v)->counter) = (i))

						Thanx, Paul

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Paul E. McKenney, (Thu Aug 9, 7:32 am)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 8:50 am)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 11:38 am)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 11:51 am)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 12:17 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 12:19 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Geert Uytterhoeven, (Thu Aug 9, 12:25 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Thu Aug 9, 4:02 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Fri Aug 10, 1:07 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Fri Aug 10, 5:38 pm)
Re: [PATCH 1/24] make atomic_read() behave consistently on ..., Segher Boessenkool, (Fri Aug 10, 5:50 pm)