public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: paulmck@linux.vnet.ibm.com
Cc: mingo@elte.hu, tglx@linutronix.de, linux-kernel@vger.kernel.org,
	linux-rt-users@vger.kernel.org
Subject: Re: BUG in 2.6.20-rt8
Date: Sun, 25 Feb 2007 18:09:27 -0800 (PST)	[thread overview]
Message-ID: <20070225.180927.112620704.davem@davemloft.net> (raw)
In-Reply-To: <20070226015230.GN5049@linux.vnet.ibm.com>

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.

  reply	other threads:[~2007-02-26  2:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-25  5:02 BUG in 2.6.20-rt8 Paul E. McKenney
2007-02-25  6:25 ` Paul E. McKenney
2007-02-25  6:27 ` Ingo Molnar
2007-02-25  6:37   ` David Miller
2007-02-26  1:52     ` Paul E. McKenney
2007-02-26  2:09       ` David Miller [this message]
2007-02-26  4:19         ` Nick Piggin
2007-02-26  1:25   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070225.180927.112620704.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox