[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090103202740.GC1666@elf.ucw.cz>
Date: Sat, 3 Jan 2009 21:27:40 +0100
From: Pavel Machek <pavel@...e.cz>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: kernel list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...l.org>, mtk.manpages@...il.com,
rdunlap@...otime.net, linux-doc@...r.kernel.org
Subject: Re: atomics: document that linux expects certain atomic behaviour
from unsigned long
On Sat 2009-01-03 20:19:55, Alan Cox wrote:
> On Sat, 3 Jan 2009 13:44:00 +0100
> Pavel Machek <pavel@...e.cz> wrote:
>
> > Linux relies on unsigned long to behave like atomic for read/write.
>
> Actually it isn't that simple and this advice shouldn't be given IMHO.
>
> unsigned long is not the same as atomic in several respects including
> ordering and caching of the result.
Ok... I keep seeing patches using int/long instead of atomic and
claiming that it is okay.
If it is okay and linux relies on it, it should be documented.
If it is not okay, I guess we should document it, too -- it seems to
be common mistake.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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