Re: [PATCH] Document Linux's memory barriers [try #2]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 9 Mar 2006, Paul Mackerras wrote:
> 
> A spin_lock does show up on the bus, doesn't it?

Nope.

If the lock entity is in a exclusive cache-line, a spinlock does not show 
up on the bus at _all_. It's all purely in the core. In fact, I think AMD 
does a spinlock in ~15 CPU cycles (that's the serialization overhead in 
the core). I think a P-M core is ~25, while the NetBurst (P4) core is much 
more because they have horrible serialization issues (I think it's on the 
order of 100 cycles there).

Anyway, try doing a spinlock in 15 CPU cycles and going out on the bus for 
it..

(Couple that with spin_unlock basically being free).

Now, if the spinlocks end up _bouncing_ between CPU's, they'll obviously 
be a lot more expensive.

		Linus
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux