From: Keir Fraser Subject: Re: [Patch] don't spin with irq disabled Date: Thu, 26 Mar 2009 14:27:27 +0000 Message-ID: References: <49CB441E.9030006@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <49CB441E.9030006@fujitsu-siemens.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Juergen Gross , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 26/03/2009 09:00, "Juergen Gross" 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