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] [xen-unstable] x86: Fix PoD cache size when decreasing m

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix PoD cache size when decreasing memory
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 04 Sep 2009 00:45:12 -0700
Delivery-date: Fri, 04 Sep 2009 00:45:29 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Fix PoD cache size when decreasing memory, Xen patchbot-unstable <=