From: Keir Fraser Subject: Re: spinlock requests (was RE: [Patch] don't spin with irq disabled) Date: Tue, 31 Mar 2009 21:57:17 +0100 Message-ID: References: <49D26857.3010508@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <49D26857.3010508@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: Dan Magenheimer , Juergen Gross , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 31/03/2009 20:00, "Jeremy Fitzhardinge" wrote: >> 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. I suspect the existing uses of rwlock in Xen actually are because that seemed a natural fit for the code -- obvious split between reader and writer critical sections -- rather than because of excessive serialisation if using a normal spinlock. I strongly disbelieve that lock acquire/release is a significant performance bottleneck for us right now. -- Keir