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

[Xen-devel] [PATCH] workaround for bug#197

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] workaround for bug#197
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Mon, 12 Sep 2005 16:27:40 -0500
Delivery-date: Mon, 12 Sep 2005 21:26:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20050909220719.GP8187@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20050909220719.GP8187@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
I don't think this is the right fix, but it does highlight the issue.
While killing a domain, the vcpus are descheduled, but every
now and then, one of the cpus is still running one of the vcpus, which
means d->cpumask is not empty.   This triggers the BUG_ON() in
xen/arch/x86/domain.c:domain_relinquish_resources().  The patch puts in
some printks and a cpu_relax() loop till the cpumask is empty before
calling domain_relinquish_resources().   With this patch, I've gone
through several thousand iterations of create/destroy without crashing.

--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@xxxxxxxxxx


diffstat output:
 domain.c |    8 ++++++++
 1 files changed, 8 insertions(+)

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---

diff -r 413c911e5780 xen/common/domain.c
--- a/xen/common/domain.c       Mon Sep 12 12:48:33 2005
+++ b/xen/common/domain.c       Mon Sep 12 13:25:07 2005
@@ -112,6 +112,14 @@
     {
         for_each_vcpu(d, v)
             sched_rem_domain(v);
+        if(!cpus_empty(d->cpumask)) {
+            printk("ACK! DOM%d still running, waiting before dying\n",
+                   d->domain_id);
+            while(!cpus_empty(d->cpumask))
+                cpu_relax();
+            printk("DOM%d cpumask clear, relinquishing resources\n", 
+                   d->domain_id);
+        }                
         domain_relinquish_resources(d);
         put_domain(d);
 

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