Re: set_current_state

Andreas Schwab (schwab@suse.de)
06 Sep 1999 12:30:28 +0200


Andrea Arcangeli <andrea@suse.de> writes:

|> On Sun, 5 Sep 1999, Jamie Lokier wrote:
|>
|> >AFAIK the ordering of volatile operations is only defined with respect
|> >to each other.
|>
|> I thought the rule was different. If that is true we should add a
|> barrier() after setting current->state in the UP code. Are you 100% sure
|> that the compiler can move not-volatile data read/write across the write
|> of a volatile var?

I think it can, as long as the volatile reference cannot alias the
non-volatile reference. Volatile references aren't general memory
barriers per se, just some form of side effect. IMHO they can even be
reordered wrt to each other if no sequence point occurs between them.

|> I can't find this information into the gcc info docs.

That's defined by the C standard.

Andreas.

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/