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] Re: IRQs, move_in_progress, -EBUSY &c

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: IRQs, move_in_progress, -EBUSY &c
From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Date: Wed, 11 Aug 2010 20:06:03 +0100
Cc: Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Wed, 11 Aug 2010 12:06:49 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=VurVT/kSgrvauG9QlVL6zhtR1kZz9X69pkotVRIl2co=; b=j3qF9fL6Zgh5T4WFC5B5PAhFybBwlvHU+VsIhnsDVrU7g9GBXoaqkhdT12odXqGXOX qYpbMn9TZ32S23233xI4gUhyDVkvIwjKN9NKiwIZ7LlpSAbNgfKZJFWg76X3rMKJB3A1 EF/RHRPovdSuYR1BLS5w/Kqucz6LRiVeJtYOU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=evaPIOwff/63KJ+rgdL76QDvsDcnOY2dkTCosVRIf2MM4/i4KG+zPfJJaX/tDV48mP HaMGzxyfxdmTTzOs70FHm+zGUGGR0mruszhIN5rPW68eWKMrBuyVKtQQl0kSA9TBPOYq ncI4a6FXfOMHjA0PsqsshkAYhNuiBBdMKKZFc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C888A811.1D715%keir.fraser@xxxxxxxxxxxxx>
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>
References: <AANLkTikXxQFyA95yb7mPV9ppQ_8Xj7oThCww-e2xy2HN@xxxxxxxxxxxxxx> <C888A811.1D715%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Looks like there are other callers of __assign_irq_vector() which also
don't handle the -EBUSY return value, namely
xen/arch/x86/io_apic.c:set_desc_affinity().

Unfortunately, set_desc_affinity() cannot simply loop until it stops
getting -EBUSY, as it is almost always called with irqs disabled -- so
the very IPI which will call the function to make it not busy anymore
is blocked.  And it only returns one value (a cpu mask), and the
function which calls it returns no value at all; so we can's pass the
"loop and retry" up one more level; we'd have to do a ton more code
rewriting to be able to handle retries.

Can we just call the cleanup function directly if we get -EBUSY?

 -George

On Wed, Aug 11, 2010 at 7:18 PM, Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:
> On 11/08/2010 18:49, "George Dunlap" <George.Dunlap@xxxxxxxxxxxxx> wrote:
>
>> Seems to work about 50/50.
>>
>> Attached is a log of a successful boot (exile.008.log), and a failed
>> boot (exile.009.log).  Suspicious things about the failed case:  the
>> usb code starts to initialize before the SATA code finishes
>> initializing, and complains that "Controller is probably using the
>> wrong IRQ".
>
> Cc'ing Xiantao Zhang, who submitted the per-CPU IDT patches. Perhaps he has
> some ideas how to fix this. The only other simple thing I can think to try
> is to modify my patch so that it loops in the hypervisor. Something like:
>  do{ ret = mp_register_gsi(...}; } while (ret == -EBUSY);
> Since the condition being EBUSYed on is cleared in hardirq context, that
> should be safe.
>
> Apart from that, it is possible that greater surgery is neede don the
> per-CPU IDT and IRQ migration logic, and I think we need Xiantao's help for
> that.
>
>  -- Keir
>
>> Keir: the machine in question (as you may have guessed) is exile; let
>> me know if you want to grab it and use it directly.
>>
>>  -George
>>
>> On Wed, Aug 11, 2010 at 4:59 PM, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
>> wrote:
>>> On 11/08/2010 15:56, "George Dunlap" <George.Dunlap@xxxxxxxxxxxxx> wrote:
>>>
>>>> However, it seems that moving IRQs is not handled properly.  Either
>>>> the pvops kernel should retry if it gets an -EBUSY, or the hypercall
>>>> should not fail, but wait until it can return success.
>>>
>>> Can you try the attached patch?
>>>
>>>  Thanks,
>>>  Keir
>>>
>>>> I discovered all this by adding debug statements to the IRQ path; the
>>>> patch is attached, if anyone else wants to use it.
>>>>
>>>>  -George
>>>
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>> http://lists.xensource.com/xen-devel
>>>
>>>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

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