Re: spin_lock forgets to clobber memory and other smp fixes [was Re: [patch] waitqueue optimization, 2.4.0-test7]

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu Sep 07 2000 - 11:15:30 EST


On Thu, 7 Sep 2000, Andrea Arcangeli wrote:

> On Mon, 4 Sep 2000, Andrea Arcangeli wrote:
>
> >barrier()). I also noticed __sti()/__save_flags() doesn't need to clobber
> >"memory".
>
> I'm not sure anymore if __sti and spin_unlock() doesn't need to clobber
> memory (it looks necessary to make sure the compiler doesn't delay to
> write data to the memory out of the critical section).

"volatile" should be equivalent to clobbering memory, although the gcc
manual pages are certainly not very verbose on the issue.

Adding a memory clobber certainly migth be a good idea. David, who knows
what gcc actually does wrt "volatile"?

                Linus

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



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:30 EST