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: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] don't spin with irq disabled
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Mar 2009 13:36:05 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 26 Mar 2009 05:36:33 -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=wYjvY69/BRc+2gSArFHv8iBesyjTSSAb5niVHWVCsmJcOv3jsVh9VPng yRMqPswGHAtHRyyr1ux3mWiBmHHMpflnS6LG/uanaWcwFT6ZSoNHSJKCw Wz35bozkXJ4Tltt;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49CB81C2.76E4.0078.0@xxxxxxxxxx>
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>
Organization: Fujitsu Siemens Computers
References: <49CB441E.9030006@xxxxxxxxxxxxxxxxxxx> <49CB81C2.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)
Jan Beulich wrote:
>>>> Juergen Gross <juergen.gross@xxxxxxxxxxxxxxxxxxx> 26.03.09 10:00 >>>
>> 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.
> 
> This is wrong - you must not enable interrupts if they weren't enabled upon
> entry to these two functions.

spin_lock_irq disables always IRQs. spin_unlock_irq enables always IRQs. They
are always used in pairs, so IRQs should always be enabled on entry of
spin_lock_irq.
I'm not enabling IRQs unconditionally in spin_lock_irqsave, of course, but use
the flags value saved before...

Did I miss something? Or did you refer only to my inexact comment above?


Juergen

-- 
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