From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: dump runq with debug key 'r' may cause dead loop Date: Fri, 04 Mar 2011 10:05:49 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Wei, Gang" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 04/03/2011 09:40, "Wei, Gang" 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@lists.xensource.com > http://lists.xensource.com/xen-devel