Linus Torvalds <[email protected]> wrote: > > A spin_lock does show up on the bus, doesn't it? > > Nope. Yes, sort of, under some circumstances. If the CPU doing the spin_lock() doesn't own the cacheline with the lock, it'll have to resort to the bus to grab the cacheline from the current owner (so another CPU would at least see a read). The effect of the spin_lock() might not be seen outside of the CPU before the spin_unlock() occurs, but it *will* be committed to the CPU's cache, and given cache coherency mechanisms, that's effectively the same as main memory. So it's in effect visible on the bus, given that it will be transferred to another CPU when requested; and as long as the other CPUs expect to see the effects and the ordering imposed, it's immaterial whether the content of the spinlock is actually ever committed to SDRAM or whether it remains perpetually in one or another's CPU cache. David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Alan Cox <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Alan Cox <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Alan Cox <[email protected]>
- [PATCH] Document Linux's memory barriers
- From: David Howells <[email protected]>
- [PATCH] Document Linux's memory barriers [try #2]
- From: David Howells <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: David Howells <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: David Howells <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: David Howells <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: David Howells <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Paul Mackerras <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Paul Mackerras <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- From: Paul Mackerras <[email protected]>
- Re: [PATCH] Document Linux's memory barriers [try #2]
- Prev by Date: Re: [PATCH] Document Linux's memory barriers
- Next by Date: RE: [patch] hugetlb strict commit accounting
- Previous by thread: Re: [PATCH] Document Linux's memory barriers [try #2]
- Next by thread: Re: [PATCH] Document Linux's memory barriers [try #2]
- Index(es):