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/
Home Products Support Community News


Re: [Xen-devel] dump runq with debug key 'r' may cause dead loop

To: "Wei, Gang" <gang.wei@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] dump runq with debug key 'r' may cause dead loop
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 04 Mar 2011 10:05:49 +0000
Delivery-date: Fri, 04 Mar 2011 02:08:51 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=NRDhnPtKsOe94MOfeqFYP2bTYc2a3dpYS74/pYRsnAE=; b=PNMH/NMfjNefXTdPxYoJ1kbbkOZnpf8p3sPP32vqYma+jC0gAXuDVThFfn8/yhmg0I 7q034VA8Tsf61RKGEgbnS/mg+8gdqhQ8yyVyh87tlqEgsK4ofFEMLdHoWGIjRnrlhP8K VEtzhO9ZnaxjGkPbmQi4MBtZO50FldD/QN0xk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=jJDeGHUx5fl01+P5iXf+Cc/j09toN4DlDVYpgOV4H6xcdgkaI29Z+nRllYSUmvXMjP AG77jeI12IDA111SgK+HID66IVyv+9ejWHYJL453mJUnrNoS8/38VDJWWkrqEnuoKB0J m70tBVJkIFHHGL2X6RR0bRX4WcU/BOWG6uleE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <F26D193E20BBDC42A43B611D1BDEDE7125E7A28293@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: AcvaUDVTlsXJvHgPTeWdS798KxMg1wAA4csf
Thread-topic: [Xen-devel] dump runq with debug key 'r' may cause dead loop
User-agent: Microsoft-Entourage/
On 04/03/2011 09:40, "Wei, Gang" <gang.wei@xxxxxxxxx> wrote:

> Recently I found dump runq with debug key 'r' may cause dead loop like below:
> (XEN) active vcpus:
> (XEN)    1: [1.0] pri=0 flags=0 cpu=0 credit=263 [w=256]
> (XEN)    2: [0.2] pri=0 flags=0 cpu=5 credit=284 [w=256]
> (XEN)    3: [0.2] pri=0 flags=0 cpu=5 credit=282 [w=256]
> ...
> (XEN)  xxxxx: [0.2] pri=0 flags=0 cpu=2 credit=54 [w=256]
> ...
> (XEN)  xxxxx: [0.2] pri=0 flags=0 cpu=3 credit=-48 [w=256]
> ...
> This means the active vcpu 0.2 became non-active just after it was access in
> the loop '2:', and that list element became empty state (head->next==next).
> Should we always hold a lock before access any schedule related list, even in
> the debug purpose dump code? If it is not acceptable, then we'd better add a
> list_empty() check in the dump functions which access schedule related list at
> least to avoid such a dead loop.

The appropriate lock should be taken. Please send a patch.

 -- Keir

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

Xen-devel mailing list