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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1252309913 -3600
# Node ID 11a597a09d213653e165887a1460715c7ff617b3
# Parent  719b67c4cc21cbaf0238d675a9b9fd696db56abe
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-unstable changeset:   20159:ead107bc25cb
xen-unstable date:        Fri Sep 04 08:43:05 2009 +0100
---
 xen/arch/x86/mm/p2m.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff -r 719b67c4cc21 -r 11a597a09d21 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Mon Sep 07 08:51:25 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c     Mon Sep 07 08:51:53 2009 +0100
@@ -624,7 +624,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 */
@@ -668,17 +668,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®.