lkml.org 
[lkml]   [2006]   [Mar]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 8 Mar 2006 21:38:36 -0800 (PST)
FromLinus Torvalds <>
SubjectRe: [PATCH] Document Linux's memory barriers [try #2]

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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-09 06:41    [from the cache]
©2003-2008