On Wed, Jul 02, 2008 at 05:59:31PM +0200, Elias Oltmanns wrote: > > The reason no locks are necessary is that there's no race to mediate. > > The checks are only is it set or not ... > > I'm not sure whether that is of any consequence. Don't get me wrong, I > really don't know and you may well be right. But how exactly does > decrementing from 2 to 1 work? Do we know for sure that there will > always be at least one bit set so reading that address will reliably > return a non zero value? The assumption we make (and it is believed to be true on all SMP systems) is that a write to a naturally aligned memory location that is sized <= sizeof(long) is atomic. That is, a reader will get either the previous value or the subsequent value, not a mixture. The RCU code relies heavily on this assumption. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html