[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] The domain structure maintains several shadow mode stats,



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 6fb3b1d9e336e6a298bdae03997741ea53eed0e8
# Parent  7e7d93aa4072eb5170d5c3699ac1ad3769a24ef6
The domain structure maintains several shadow mode stats,
such as shadow page counts for l1 & l2, hl2 tables, snapshots,
etc.  These counts are not decremented properly when we
free shadow pages.  The following patch fixes this problem.

Signed-off-by: Khoa Huynh <khoa@xxxxxxxxxx>

diff -r 7e7d93aa4072 -r 6fb3b1d9e336 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Sun Sep 18 07:38:25 2005
+++ b/xen/arch/x86/shadow32.c   Mon Sep 19 09:00:26 2005
@@ -399,22 +399,26 @@
         perfc_decr(shadow_l1_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_l1_table(d, smfn);
+        d->arch.shadow_page_count--;
         break;
 
     case PGT_l2_shadow:
         perfc_decr(shadow_l2_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_l2_table(d, smfn, page->u.inuse.type_info);
+        d->arch.shadow_page_count--;
         break;
 
     case PGT_hl2_shadow:
         perfc_decr(hl2_table_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_hl2_table(d, smfn);
+        d->arch.hl2_page_count--;
         break;
 
     case PGT_snapshot:
         perfc_decr(snapshot_pages);
+        d->arch.snapshot_page_count--;
         break;
 
     default:
@@ -422,8 +426,6 @@
                page_to_pfn(page), page->u.inuse.type_info);
         break;
     }
-
-    d->arch.shadow_page_count--;
 
     // No TLB flushes are needed the next time this page gets allocated.
     //
diff -r 7e7d93aa4072 -r 6fb3b1d9e336 xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Sun Sep 18 07:38:25 2005
+++ b/xen/arch/x86/shadow_public.c      Mon Sep 19 09:00:26 2005
@@ -595,18 +595,21 @@
         perfc_decr(shadow_l1_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_l1_table(d, smfn);
+        d->arch.shadow_page_count--;
         break;
 #if defined (__i386__)
     case PGT_l2_shadow:
         perfc_decr(shadow_l2_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_l2_table(d, smfn, page->u.inuse.type_info);
+        d->arch.shadow_page_count--;
         break;
 
     case PGT_hl2_shadow:
         perfc_decr(hl2_table_pages);
         shadow_demote(d, gpfn, gmfn);
         free_shadow_hl2_table(d, smfn);
+        d->arch.hl2_page_count--;
         break;
 #else
     case PGT_l2_shadow:
@@ -614,12 +617,13 @@
     case PGT_l4_shadow:
         shadow_demote(d, gpfn, gmfn);
         free_shadow_tables(d, smfn, shadow_type_to_level(type));
+        d->arch.shadow_page_count--;
         break;
 
     case PGT_fl1_shadow:
         free_shadow_fl1_table(d, smfn);
+        d->arch.shadow_page_count--;
         break;
-
 #endif
 
     case PGT_snapshot:
@@ -631,8 +635,6 @@
                page_to_pfn(page), page->u.inuse.type_info);
         break;
     }
-
-    d->arch.shadow_page_count--;
 
     // No TLB flushes are needed the next time this page gets allocated.
     //

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.