WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [Patch] don't spin with irq disabled

To: Juergen Gross <juergen.gross@xxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] don't spin with irq disabled
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 26 Mar 2009 14:27:27 +0000
Cc:
Delivery-date: Thu, 26 Mar 2009 07:28:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49CB441E.9030006@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acmt8V1xKeunGHPaSbGIYcokZpJVPQALZ9WE
Thread-topic: [Xen-devel] [Patch] don't spin with irq disabled
User-agent: Microsoft-Entourage/12.15.0.081119
On 26/03/2009 09:00, "Juergen Gross" <juergen.gross@xxxxxxxxxxxxxxxxxxx>
wrote:

> Attached patch reduces interrupt latency in lock handling.
> spin_lock_irq and spin_lock_irqsave used to turn off IRQs and then tried to
> get the lock. If the lock was already held, waiting for the lock was done with
> IRQs still off.
> The patch reenables IRQs during the wait loop.
> 
> read/write locks seem to be rarely used, so I didn't change them.
> 
> In favor for ia64 I chose not to modify the assembler code :-)

This will ping-pong the spinlock cache line when spinning among multiple
processors. Still, getting rid of _raw_spin_lock is an interesting idea, and
perhaps your scheme will work okay if modified as:
 while (unlikely(!raw_spin_trylock))
  while (likely(raw_spin_is_locked))
    ...;
I'll think about it -- certainly it would cull loads of crap from ia64's
spinlock.h. No need to send another patch.

 -- Keir



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