[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: spinlock requests (was RE: [Xen-devel] [Patch] don't spin with irq disabled)


  • To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
  • From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 31 Mar 2009 15:40:20 +0200
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 31 Mar 2009 06:41:13 -0700
  • Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=Ho0TIPAlrJjk4v/qH8zWk9b0y4+4DXtYBzl6HhZpKrT1v7vHA/r+6kPv W4mpPdrNjEbTQhiI/dJWXw/mxBGQj8h95Zuks8Lt4or9QyadtUOrLZv8a v2guXL3+fV2Aj8k;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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.


Juergen

>> -----Original Message-----
>> From: Juergen Gross [mailto:juergen.gross@xxxxxxxxxxxxxxxxxxx]
>> Sent: Monday, March 30, 2009 12:12 AM
>> To: Dan Magenheimer
>> Cc: Keir Fraser; Jan Beulich; xen-devel@xxxxxxxxxxxxxxxxxxx
>> Subject: Re: spinlock requests (was RE: [Xen-devel] [Patch] don't spin
>> with irq disabled)
>>
>> if you are planning to use rw_locks you should be aware that 
>> the current
>> implementation in Xen is sub-optimal on systems with high 
>> processor counts.
>> Read locks always succeed when other readers are already 
>> holding the lock,
>> even if a writer is waiting for the lock. If there are many 
>> potential readers
>> they might (in theory) lock out a writer for rather long times.
>> A better solution would be to stop further readers to acquire 
>> the lock if a
>> writer is waiting for it.



-- 
Juergen Gross                             Principal Developer
IP SW OS6                      Telephone: +49 (0) 89 636 47950
Fujitsu Siemens Computers         e-mail: juergen.gross@xxxxxxxxxxxxxxxxxxx
Otto-Hahn-Ring 6                Internet: www.fujitsu-siemens.com
D-81739 Muenchen         Company details: www.fujitsu-siemens.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.