[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46C54D94.5080803@yahoo.com.au>
Date: Fri, 17 Aug 2007 17:26:12 +1000
From: Nick Piggin <nickpiggin@...oo.com.au>
To: Satyam Sharma <satyam@...radead.org>
CC: Linus Torvalds <torvalds@...ux-foundation.org>,
Paul Mackerras <paulus@...ba.org>,
Segher Boessenkool <segher@...nel.crashing.org>,
heiko.carstens@...ibm.com, horms@...ge.net.au,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
rpjday@...dspring.com, ak@...e.de, netdev@...r.kernel.org,
cfriesen@...tel.com, Andrew Morton <akpm@...ux-foundation.org>,
jesper.juhl@...il.com, linux-arch@...r.kernel.org, zlynx@....org,
clameter@....com, schwidefsky@...ibm.com,
Chris Snook <csnook@...hat.com>,
Herbert Xu <herbert.xu@...hat.com>, davem@...emloft.net,
wensong@...ux-vs.org, wjiang@...ilience.com
Subject: Re: [PATCH 0/24] make atomic_read() behave consistently across all
architectures
Satyam Sharma wrote:
> #define atomic_read_volatile(v) \
> ({ \
> forget((v)->counter); \
> ((v)->counter); \
> })
>
> where:
*vomit* :)
Not only do I hate the keyword volatile, but the barrier is only a
one-sided affair so its probable this is going to have slightly
different allowed reorderings than a real volatile access.
Also, why would you want to make these insane accessors for atomic_t
types? Just make sure everybody knows the basics of barriers, and they
can apply that knowledge to atomic_t and all other lockless memory
accesses as well.
> #define forget(a) __asm__ __volatile__ ("" :"=m" (a) :"m" (a))
I like order(x) better, but it's not the most perfect name either.
--
SUSE Labs, Novell Inc.
-
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