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] Fix Xen panic with oprofile

To: "Xen Developers" <xen-devel@xxxxxxxxxxxxxxxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix Xen panic with oprofile
From: "Niraj Tolia" <ntolia@xxxxxxxxx>
Date: Tue, 2 Dec 2008 00:52:00 -0800
Cc: "Santos, Jose Renato G" <joserenato.santos@xxxxxx>, "Monchiero, Matteo" <matteo.monchiero@xxxxxx>
Delivery-date: Tue, 02 Dec 2008 00:52:26 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=2MSyj4K9LKRQ3cl4tzovkvEnDp2XJ4CKzaKHeJTs9FI=; b=R8MQ2UJHA9m84LOpojzZC4vbE23Ct47JsgLeEpy92FKcM0FFByctaf7usOoSRu7WEZ PMXYZxBRlnfZVMfHk5ymvAiblLWvttxxvqqrobj2Vs4ny0t2m2LWNNWl/aFVvkag3/90 Jx0JykCFBimWDQzf4E9/CQd2JH7iUhdiS0Q3s=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=NNHoIowCLHqW86Zk6zOR483eApfHXn64EJ6zJXuCYKJcE1uG2YCpXm/b96PtfzDZiH YkuANJOLcda0e32NDnjSbJ4GQ505tuEJx/AqxsWylsZoC5FCZmymZ4PxCSTA8iUw9Pcj Psl2Utbi9xNki6PwiL7Rmy5Gn0YeNS5dWuH8I=
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
The attached patch fixes a Xen panic when a domain is shutdown before
oprofile is stopped. Without this patch, free_xenoprof_pages() is
called before the domain is destroyed and that, in turn, prevents
oprofile from cleaning up pages shared with guests. Shutting down a
domain without terminating oprofile therefore causes a Xen panic at a
later point in time.

The patch was generated against Xen 3.3.0 but will cleanly apply to
both xen-3.3-testing and xen-unstable. It has only been tested on
x86_32 but the ia64 portion of it should (hopefully) be obvious.

Note that I needed to backport the patch from [1] to get samples on my
processor (Xeon X5355) but, as the patch doesn't seem to have gone
into mainline yet [2], I am holding off on submitting it here.

Cheers,
Niraj

[1] http://lkml.org/lkml/2008/11/11/62
[2] http://lkml.org/lkml/2008/11/17/282



Signed-off-by: Niraj Tolia <niraj.tolia@xxxxxx>

diff -r 18eff064c628 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Fri Aug 22 10:45:19 2008 +0100
+++ b/xen/arch/ia64/xen/domain.c        Mon Dec 01 23:52:14 2008 -0800
@@ -1673,9 +1673,6 @@ int domain_relinquish_resources(struct d
        if (is_hvm_domain(d) && d->arch.sal_data)
                xfree(d->arch.sal_data);

-       /* Free page used by xen oprofile buffer */
-       free_xenoprof_pages(d);
-
        return 0;
 }

diff -r 18eff064c628 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Fri Aug 22 10:45:19 2008 +0100
+++ b/xen/arch/x86/domain.c     Mon Dec 01 23:52:14 2008 -0800
@@ -1817,9 +1817,6 @@ int domain_relinquish_resources(struct d
         BUG();
     }

-    /* Free page used by xen oprofile buffer. */
-    free_xenoprof_pages(d);
-
     if ( is_hvm_domain(d) )
         hvm_domain_relinquish_resources(d);

diff -r 18eff064c628 xen/common/domain.c
--- a/xen/common/domain.c       Fri Aug 22 10:45:19 2008 +0100
+++ b/xen/common/domain.c       Mon Dec 01 23:52:14 2008 -0800
@@ -534,6 +534,9 @@ static void complete_domain_destroy(stru

     sched_destroy_domain(d);

+    /* Free page used by xen oprofile buffer. */
+    free_xenoprof_pages(d);
+
     for ( i = MAX_VIRT_CPUS-1; i >= 0; i-- )
         if ( (v = d->vcpu[i]) != NULL )
             free_vcpu_struct(v);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix Xen panic with oprofile, Niraj Tolia <=