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] x86/IRQ: fix create_irq() after c/s 24068:692817

To: Jan Beulich <JBeulich@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86/IRQ: fix create_irq() after c/s 24068:6928172f7ded
From: Keir Fraser <keir@xxxxxxx>
Date: Fri, 04 Nov 2011 16:34:10 +0000
Cc: andrew.cooper3@xxxxxxxxxx, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Haitao Shan <haitao.shan@xxxxxxxxx>, xiantao.zhang@xxxxxxxxx
Delivery-date: Fri, 04 Nov 2011 09:35:33 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=NRf+j6UbEd/cSQztbdd5zP5mQzcaJzrFp32cOq94gG0=; b=cIo+8C5BV8v/H0O0eQnfmGWdvmSAzvRlmz9valGAwRRcX3QThPQpkYCOt/+VDS8Epu 13nSGZr6REaRLv5qITQ8Gc+3WCPpeZKKd20DOnM3d0ZUCrV3TSno8ra8w2dJQhESh0Qq 9zMWaRD9ITZIk3wZlUN03mw8/EYsGt/hIQBlk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EB40D3C020000780005F192@xxxxxxxxxxxxxxxxxxxx>
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: AcybD5QxEWGXzPIiakiTff9ddZOxyw==
Thread-topic: [Xen-devel] [PATCH] x86/IRQ: fix create_irq() after c/s 24068:6928172f7ded
User-agent: Microsoft-Entourage/12.30.0.110427
On 04/11/2011 15:05, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>>>> On 04.11.11 at 15:41, Keir Fraser <keir@xxxxxxx> wrote:
>> On 04/11/2011 11:52, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:
>> 
>>> init_one_irq_desc() must be called with interrupts enabled (as it may
>>> call functions from the xmalloc() group). Rather than mis-using
>>> vector_lock to also protect the finding of an unused IRQ, make this
>>> lockless through using cmpxchg(), and obtain the lock only around the
>>> actual assignment of the vector.
>> 
>> Looks fine to me.
>> 
>> Acked-by: Keir Fraser <keir@xxxxxxx>
>> 
>>> Also fold find_unassigned_irq() into its only caller.
>>> 
>>> It is, btw, questionable whether create_irq() calling
>>> __assign_irq_vector() (rather than assign_irq_vector()) is actually
>>> correct - desc->affinity appears to not get initialized properly in
>>> this case.
> 
> Any thought on this one? Adjusting this would have the nice side
> effect of the function no longer explicitly acquiring vector_lock.

I would agree it should call assign_irq_vector(). It was probably only
taking the lock itself, and thus using __assign_irq_vector(), to avoid the
irq it found in find_unassigned_irq() being stolen. That can't happen now
you reserve it via cmpxchg.

 -- Keir

> Jan
> 



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