From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
Juergen Gross <juergen.gross@fujitsu-siemens.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: spinlock requests (was RE: [Patch] don't spin with irq disabled)
Date: Tue, 31 Mar 2009 12:00:39 -0700 [thread overview]
Message-ID: <49D26857.3010508@goop.org> (raw)
In-Reply-To: <C5F7DDB2.54D5%keir.fraser@eu.citrix.com>
Keir Fraser wrote:
> On 31/03/2009 14:40, "Juergen Gross" <juergen.gross@fujitsu-siemens.com>
> wrote:
>
>
>> Dan Magenheimer wrote:
>>
>>> Thanks Juergen. Do you know of any GPLv2 code that implements
>>> this improved rwlock solution? (I don't think Linux does,
>>> does it?)
>>>
>> Good question.
>> I just looked into the Linux code and decided not to analyse it. :-)
>> I have implemented a solution for our BS2000 system on Xen. It is just
>> a rather simple state machine using the cmpxchg instruction for the
>> update of the (structured) lock word.
>> If there is common interest for this solution I could prepare a patch.
>>
>
> If we care that much about fairness we should use ticket- or queue-based
> locks. I don't believe any of our locks are contended enough to be a
> concern. If they were, that would be a concern in itself.
>
Writer vs reader fairness in rwlocks is different from normal spinlock
fairness. One presumes that you're expecting to get multiple readers if
you choose to use a rwlock, but that can end up excluding writers for an
unbounded amount of time.
There was a big discussion of this on lkml about 6-9 months ago, because
people were seeing writers held off for long periods of time. I think
the kernel's rwlock now blocks new readers if a writer if waiting for
the lock.
J
next prev parent reply other threads:[~2009-03-31 19:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-26 9:00 [Patch] don't spin with irq disabled Juergen Gross
2009-03-26 12:23 ` Jan Beulich
2009-03-26 12:36 ` Juergen Gross
2009-03-27 7:41 ` Jan Beulich
2009-03-27 9:09 ` Keir Fraser
2009-03-27 17:00 ` spinlock requests (was RE: [Patch] don't spin with irq disabled) Dan Magenheimer
2009-03-27 17:46 ` Keir Fraser
2009-03-27 18:00 ` Dan Magenheimer
2009-03-27 18:12 ` Keir Fraser
2009-04-02 23:08 ` Dan Magenheimer
2009-04-03 7:17 ` Keir Fraser
2009-03-30 6:11 ` Juergen Gross
2009-03-31 13:12 ` Dan Magenheimer
2009-03-31 13:40 ` Juergen Gross
2009-03-31 13:48 ` Keir Fraser
2009-03-31 19:00 ` Jeremy Fitzhardinge [this message]
2009-03-31 20:57 ` Keir Fraser
2009-03-31 21:16 ` Jeremy Fitzhardinge
2009-03-26 14:27 ` [Patch] don't spin with irq disabled Keir Fraser
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=49D26857.3010508@goop.org \
--to=jeremy@goop.org \
--cc=dan.magenheimer@oracle.com \
--cc=juergen.gross@fujitsu-siemens.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.