Re: user-mode port 0.44-2.4.7

From: Anton Altaparmakov (
Date: Tue Jul 24 2001 - 13:07:47 EST

At 17:52 24/07/2001, Davide Libenzi wrote:
>On 24-Jul-2001 Alexander Viro wrote:
> > On Tue, 24 Jul 2001, Davide Libenzi wrote:
>You're simply telling the compiler the way it has to ( not ) optimize the
>This is IMHO a declaration time issue.
>Looking at this code :
>while (jiffies < ...) {
> ...
>the "natural" behaviour that a reader expects is that the "content" of the
>memory pointed by jiffied is loaded and compared.

Well, that depends on your definition of "natural". In my definition, it
would be absolutely normal in this example for the compiler to cache
jiffies because it considers it as a non-changing variable if none of the
code inside the while loop refers to jiffies again. But that's just me...

>If you like this code more :
>for (;;) {
> barrier();
> if (jiffies >= ...)
> break;
> ...

Er, what is wrong with:

while (barrier(), jiffies < ...) {

It is just as clean as the starting point but tells both the compiler at
compile time and _me_ when reading the code that jiffies is expected to
change under me.

That is _way_ better than declaring it volatile in some obsure header file
which, chances are, I have never looked at, or looked at and long forgotten

Just my 2p.


   "Nothing succeeds like success." - Alexandre Dumas
Anton Altaparmakov <aia21 at> (replace at with @)
Linux NTFS Maintainer / WWW:
ICQ: 8561279 / WWW:

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:18 EST