lkml.org 
[lkml]   [2007]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: BUG in 2.6.20-rt8
From
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Sun, 25 Feb 2007 17:52:30 -0800

> Why doesn't the traditional hash table of locks work here? Use the
> cache-line address as input to the hash function, take the corresponding
> lock, do the compare-and-exchange by hand, and then release the lock.
> What am I missing here? Address aliasing do to memory being mapped into
> multiple locations or something? (In that case, use only the portion
> of the address within the page, right?)

It doesn't protect against pure stores.

Even ignoring that you'll also need to disable interrupts, always,
which therefore will always perform very poorly compared to an
open-coded spinlock variant.

There are zero gains to cmpxchg(), in my opinion, you dirty and
grab exclusive access to a cacheline with cmpxchg() just the
same as a spinlock, so the real cost is the same.

There is zero justification for using this primitive in generic
code.
-
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: 2007-02-26 03:13    [W:0.114 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site