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

[Xen-changelog] [xen-unstable] x86: Fix PoD cache size when decreasing memory



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1252050185 -3600
# Node ID ead107bc25cb18143213d271b4122bf87d790228
# Parent  f9ce5858f7eae84bec34aa10d3585c7e6f6ca6c9
x86: Fix PoD cache size when decreasing memory

Certain paths through p2m_pod_decrease_reservation() fail to reduce
the size of the PoD cache if the number of outstanding entries is less
than the size of the cache.  Rearrange so this doesn't happen.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff -r f9ce5858f7ea -r ead107bc25cb xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Sep 04 08:42:10 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Sep 04 08:43:05 2009 +0100
@@ -634,7 +634,7 @@ p2m_pod_decrease_reservation(struct doma
         p2md->pod.entry_count-=(1<<order); /* Lock: p2m */
         BUG_ON(p2md->pod.entry_count < 0);
         ret = 1;
-        goto out_unlock;
+        goto out_entry_check;
     }
 
     /* FIXME: Steal contig 2-meg regions for cache */
@@ -678,17 +678,18 @@ p2m_pod_decrease_reservation(struct doma
         }
     }    
 
-    /* If we've reduced our "liabilities" beyond our "assets", free some */
-    if ( p2md->pod.entry_count < p2md->pod.count )
-    {
-        printk("b %d\n", p2md->pod.entry_count);
-        p2m_pod_set_cache_target(d, p2md->pod.entry_count);
-    }
-
     /* If there are no more non-PoD entries, tell decrease_reservation() that
      * there's nothing left to do. */
     if ( nonpod == 0 )
         ret = 1;
+
+out_entry_check:
+    /* If we've reduced our "liabilities" beyond our "assets", free some */
+    if ( p2md->pod.entry_count < p2md->pod.count )
+    {
+        printk("b %d\n", p2md->pod.entry_count);
+        p2m_pod_set_cache_target(d, p2md->pod.entry_count);
+    }
 
 out_unlock:
     audit_p2m(d);

_______________________________________________
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®.