All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
	Dave Olson <olson@unixfolk.com>,
	ccb@acm.org, linux-kernel@vger.kernel.org,
	Peter Chubb <peter@chubb.wattle.id.au>
Subject: Re: [patch] increase spinlock-debug looping timeouts (write_lock and NMI)
Date: Wed, 21 Jun 2006 01:16:52 +1000	[thread overview]
Message-ID: <44981164.3000406@yahoo.com.au> (raw)
In-Reply-To: <1150815237.2891.205.camel@laptopd505.fenrus.org>

Arjan van de Ven wrote:
>>Taking the lock is going to transiation the cacheline to exclusive. If
>>the next locker tries to take the lock, they transfer the cacheline and
>>exclusive access and fail. If they have already tried to take the lock
>>earlier, they might only request a readonly state, but it still requires
>>a cacheline transfer (which is the expensive part).
> 
> 
> the "which is the expensive part" isn't entirely true on modern hardware
> (and for sure not on multicore systems); due to various bus snooping
> tricks and other "pass-the-cacheline" tricks this is relatively cheap;
> not free obviously but not nearly as expensive as the exclusive part.

Yes, I meant the entire process of getting the cacheline. The cache
coherency is the larger part of the cost (except maybe with shared
cache multi cores), however you make it sound like getting exclusive
access is fundamentally more expensive than getting shared access.
(ok, once you *have* shared access, no problems, but *getting* it is
still expensive).

With broadcast snooping cache coherency with MESI, the "getting
exclusive" shouldn't be hugely more expensive than "getting shared".
Either way the owner has to write out the line and cause the requester
to retry iff it was dirty. Then, in the former case, the owner should
probably mark their line invalid, in the latter, just shared.

With MOESI, both cases will still have to do the broadcast snoop
AFAIK.

Not sure about fancier snoop filters or directory protocols. I can't
see why getting E would be that much more expensive than getting S in
this situation (sure, in situations where lots of entities are also in
S, getting an E might require more invalidates to be sent out...).

And either way, spinlocks are still much more costly than rwlocks,
because they still have that first exclusive request, who's
effectiveness deteriorates under load. That you *also* have these
follow on shared accesses (which will need to be invalidated somehow
later anyway), doesn't make them better than read locks.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-06-20 16:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.VT2rwoX1M/2O/aO5crhlRDNx4YA@ifi.uio.no>
     [not found] ` <fa.Zp589GPrIISmAAheRowfRgZ1jgs@ifi.uio.no>
2006-06-20  5:35   ` [patch] increase spinlock-debug looping timeouts (write_lock and NMI) Dave Olson
2006-06-20  6:39     ` Andrew Morton
2006-06-20  6:53       ` Dave Jones
2006-06-20  7:37       ` Nick Piggin
2006-06-20  8:03         ` Andrew Morton
2006-06-20  8:33         ` Ingo Molnar
2006-06-20  9:37           ` Nick Piggin
2006-06-20  9:51             ` Ingo Molnar
2006-06-20 10:59               ` Nick Piggin
2006-06-20 13:04                 ` Arjan van de Ven
2006-06-20 13:28                   ` update pci device id cckuo
2006-06-20 14:06                     ` Arjan van de Ven
2006-06-20 13:36                   ` [patch] increase spinlock-debug looping timeouts (write_lock and NMI) Nick Piggin
2006-06-20 14:53                     ` Arjan van de Ven
2006-06-20 15:16                       ` Nick Piggin [this message]
2006-06-20 16:27                         ` Nick Piggin
2006-06-20  8:43         ` Arjan van de Ven
2006-06-20 16:11       ` Dave Olson
2006-06-20 21:10         ` Andrew Morton
2006-06-22  5:45 Dave Olson
2006-06-22  5:57 ` Andrew Morton
2006-06-23  7:57 ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2006-06-23 16:27 Dave Olson

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=44981164.3000406@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=ccb@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=olson@unixfolk.com \
    --cc=peter@chubb.wattle.id.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.