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-changelog

[Xen-changelog] Don't unshadow when the shadow l2 is the current used sh

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Don't unshadow when the shadow l2 is the current used shadow table.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 08 Dec 2005 19:12:07 +0000
Delivery-date: Thu, 08 Dec 2005 19:12:52 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5f7398785e02a753d50c022b6dbe5a6983166f89
# Parent  29055c5ad51dabf44d855cdce41f192d2fe724aa
Don't unshadow when the shadow l2 is the current used shadow table.
Otherwise, when destroying the domain, if the current sl2 is unpinned
then the shadow page will be freed without accquire the shadow_lock.
This may also improve the performance due to avoiding uncessary
unshadow.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>

diff -r 29055c5ad51d -r 5f7398785e02 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Thu Dec  8 14:18:13 2005
+++ b/xen/arch/x86/shadow.c     Thu Dec  8 14:21:36 2005
@@ -1450,6 +1450,7 @@
     int changed;
     u32 min_max_shadow, min_max_snapshot;
     int min_shadow, max_shadow, min_snapshot, max_snapshot;
+    struct vcpu *v;
 
     ASSERT(shadow_lock_is_acquired(d));
 
@@ -1739,6 +1740,9 @@
 
         if ( unlikely(unshadow) )
         {
+            for_each_vcpu(d, v)
+                if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+                    return need_flush;
             perfc_incrc(unshadow_l2_count);
             shadow_unpin(smfn);
 #if CONFIG_PAGING_LEVELS == 2
diff -r 29055c5ad51d -r 5f7398785e02 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Thu Dec  8 14:18:13 2005
+++ b/xen/arch/x86/shadow32.c   Thu Dec  8 14:21:36 2005
@@ -2326,6 +2326,7 @@
     int changed;
     u32 min_max_shadow, min_max_snapshot;
     int min_shadow, max_shadow, min_snapshot, max_snapshot;
+    struct vcpu *v;
 
     ASSERT(shadow_lock_is_acquired(d));
 
@@ -2527,6 +2528,9 @@
 
         if ( unlikely(unshadow) )
         {
+            for_each_vcpu(d, v)
+                if(smfn == pagetable_get_pfn(v->arch.shadow_table))
+                    return need_flush;
             perfc_incrc(unshadow_l2_count);
             shadow_unpin(smfn);
             if ( unlikely(shadow_mode_external(d)) )

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Don't unshadow when the shadow l2 is the current used shadow table., Xen patchbot -unstable <=