xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Felipe Franciosi <felipe.franciosi@citrix.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Matt Wilson <msw@amazon.com>, Matt Wilson <msw@linux.com>,
	xen-devel@lists.xenproject.org, roger.pau@citrix.com
Subject: Re: [RFC PATCH 2/2] gnttab: refactor locking for better scalability
Date: Tue, 12 Nov 2013 14:24:50 +0000	[thread overview]
Message-ID: <CEA7EAB2.64D29%keir.xen@gmail.com> (raw)
In-Reply-To: <528245120200007800102642@nat28.tlf.novell.com>

On 12/11/2013 14:11, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 12.11.13 at 14:58, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 12/11/2013 13:42, "Keir Fraser" <keir.xen@gmail.com> wrote:
>> 
>>>> And indeed I think we should be making our rwlocks fair for writers
>>>> before pushing in the change here; I've been meaning to get to this
>>>> for a while, but other stuff continues to require attention. I'm also
>>>> of the opinion that we should switch to ticket spinlocks.
>>> 
>>> Would queuing spinlocks (e.g. MCS locks) be even more preferable? Two atomic
>>> ops (cmpxchg) per critical region in the uncontended case. Each CPU spins on
>>> its own location so there's no cacheline carnage in the highly contended
>>> case (a problem with simple ticket spinlocks). And it builds on cmpxchg so
>>> the spinlock implementation has no arch-specific component (apart from
>>> cmpxchg, which we already have).
>>> 
>>> I have a queue-based rwlock design too, does require a spinlock lock/unlock
>>> per rwlock op though (i.e., 4 atomic ops per critical region in the
>>> uncontended case).
>> 
>> Actually MCS has a multi-reader extension we could use, or there is another
>> alternative by Krieger et al. My own design was intended to build on pthread
>> primitives and wouldn't be as good as the existing solutions in the
>> literature for purely spinning waiters.
> 
> Sounds nice - are you going to spend time on implementing this then?

Yes I'll look into it. Amazon's benchmarking of grant-table throughput will
be a good testbed for performance of a different lock implementation.

 -- Keir

> Jan
> 

  reply	other threads:[~2013-11-12 14:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12  2:03 [RFC PATCH 0/2] gnttab: refactor locking for better scalability Matt Wilson
2013-11-12  2:03 ` [RFC PATCH 1/2] gnttab: lock the local grant table earlier in __gnttab_unmap_common() Matt Wilson
2013-11-12  2:03 ` [RFC PATCH 2/2] gnttab: refactor locking for better scalability Matt Wilson
2013-11-12  5:37   ` Keir Fraser
2013-11-12  7:18     ` Matt Wilson
2013-11-12  8:07       ` Keir Fraser
2013-11-12  9:18         ` Jan Beulich
2013-11-12 13:42           ` Keir Fraser
2013-11-12 13:58             ` Keir Fraser
2013-11-12 14:11               ` Jan Beulich
2013-11-12 14:24                 ` Keir Fraser [this message]
2013-11-12 15:09                   ` Felipe Franciosi
2014-06-20 20:54                   ` Konrad Rzeszutek Wilk
2014-06-20 21:18                     ` Matt Wilson
2013-11-12 19:06         ` Matt Wilson
2013-11-12 14:52       ` Konrad Rzeszutek Wilk
2013-11-12 15:04         ` David Vrabel
2013-11-12 16:53           ` Anthony Liguori
2013-11-12  9:26   ` Jan Beulich
2013-11-12 17:58     ` Matt Wilson
2013-11-13  7:39       ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2014-06-21  0:13 Konrad Rzeszutek Wilk

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=CEA7EAB2.64D29%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=aliguori@amazon.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=felipe.franciosi@citrix.com \
    --cc=msw@amazon.com \
    --cc=msw@linux.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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;
as well as URLs for NNTP newsgroup(s).