Re: [PATCH] volatile may be needed in rwsem

From: Christian Borntraeger
Date: Tue Jan 27 2004 - 15:22:01 EST


Joe Korty wrote:
> 'flags' should be declared volatile as rwsem_down_failed_common() spins
> waiting for this to change. Untested.


You should use barrier() to prevent the compiler from optimizing reads away,
not volatile.
Here the compiler hopefully considers schedule() as a memory barrier. So
everything should be fine.

cheers

Christian

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