Re: user-mode port 0.44-2.4.7

From: Chris Friesen (
Date: Mon Jul 23 2001 - 15:44:06 EST

Linus Torvalds wrote:
> On Mon, 23 Jul 2001, Andrea Arcangeli wrote:
> >
> > gcc can assume 'state' stays constant in memory not just during the
> > 'case'.
> The point is that if the kernel has _any_ algorithm where it cares, it's a
> kernel bug. With volatile or without.
> SHOW ME THE CASE WHERE IT CARES. Let's fix it. Let's not just hide it with
> "volatile".

If I understand correctly, xtime is updated asynchronously. If it isn't, then
ignore this message totally. However, if it is, then *not* specifying it as
volatile could easily cause problems in technically correct but poorly written

Suppose I loop against xtime reaching a particular value. While this is
definately not good practice, if xtime is not specified as volatile then since I
never modify it within the loop the compiler is free to move the initial load
out of the loop when optimizing. In this example the case where it is marked as
volatile will run (though inefficiently), but the non-volatile case can hang

Do we want to get ourselves into something like this?


Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email:
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 : Mon Jul 23 2001 - 21:00:17 EST