[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070809034720.GA12996@linux.vnet.ibm.com>
Date: Wed, 8 Aug 2007 20:47:20 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: David Miller <davem@...emloft.net>
Cc: herbert@...dor.apana.org.au, csnook@...hat.com,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
ak@...e.de, heiko.carstens@...ibm.com,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
schwidefsky@...ibm.com, wensong@...ux-vs.org, horms@...ge.net.au,
wjiang@...ilience.com, cfriesen@...tel.com, zlynx@....org
Subject: Re: [PATCH] make atomic_t volatile on all architectures
On Wed, Aug 08, 2007 at 06:48:24PM -0700, David Miller wrote:
> From: Herbert Xu <herbert@...dor.apana.org.au>
> Date: Thu, 09 Aug 2007 09:03:27 +0800
>
> > Such loops should always use something like cpu_relax() which comes
> > with a barrier.
>
> This is an excellent point.
>
> And it needs to be weighed with the error prone'ness Andrew mentioned.
> There probably is a middle ground somewhere.
OK... I'll bite. ACCESS_ONCE(), see http://lkml.org/lkml/2007/7/11/664.
This would allow ACCESS_ONCE(atomic_read(&x)) to be used where refetching
would be problematic, but allow the compiler free rein in cases where
refetching is OK.
The ACCESS_ONCE() primitive of course has its limitations as well, but
you did ask for a middle ground. ;-)
Thanx, Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists