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


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

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] dump runq with debug key 'r' may cause dead loop
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Fri, 4 Mar 2011 17:40:33 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: "Wei, Gang" <gang.wei@xxxxxxxxx>
Delivery-date: Fri, 04 Mar 2011 01:41:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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: AcvaUDVTlsXJvHgPTeWdS798KxMg1w==
Thread-topic: dump runq with debug key 'r' may cause dead loop
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.


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>