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/mm: shuffle log-dirty code so only on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/mm: shuffle log-dirty code so only one path allocates memory
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 11 Feb 2011 06:20:15 -0800
Delivery-date: Fri, 11 Feb 2011 06:22:03 -0800
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 Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1297337271 0
# Node ID 0df1b42910b10055721d37a88233e5f140169197
# Parent  19b2424be183b392daa12364bbde4f9bcb0edaae
x86/mm: shuffle log-dirty code so only one path allocates memory

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/mm/paging.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff -r 19b2424be183 -r 0df1b42910b1 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c  Thu Feb 10 09:02:50 2011 +0000
+++ b/xen/arch/x86/mm/paging.c  Thu Feb 10 11:27:51 2011 +0000
@@ -132,17 +132,12 @@ static mfn_t paging_new_log_dirty_node(s
     return mfn;
 }
 
-/* get the top of the log-dirty bitmap trie, allocating if necessary */
+/* get the top of the log-dirty bitmap trie */
 static mfn_t *paging_map_log_dirty_bitmap(struct domain *d)
 {
-    mfn_t *mapping;
-
     if ( likely(mfn_valid(d->arch.paging.log_dirty.top)) )
         return map_domain_page(mfn_x(d->arch.paging.log_dirty.top));
-
-    d->arch.paging.log_dirty.top = paging_new_log_dirty_node(d, &mapping);
-
-    return mapping;
+    return NULL;
 }
 
 static void paging_free_log_dirty_page(struct domain *d, mfn_t mfn)
@@ -262,8 +257,12 @@ void paging_mark_dirty(struct domain *d,
     i4 = L4_LOGDIRTY_IDX(pfn);
 
     l4 = paging_map_log_dirty_bitmap(d);
-    if ( !l4 )
-        goto out;
+    if ( unlikely(!l4) )
+    {
+        d->arch.paging.log_dirty.top = paging_new_log_dirty_node(d, &l4);
+        if ( !l4 )
+            goto out;
+    }
     mfn = l4[i4];
     if ( !mfn_valid(mfn) )
         mfn = l4[i4] = paging_new_log_dirty_node(d, &l3);

_______________________________________________
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/mm: shuffle log-dirty code so only one path allocates memory, Xen patchbot-unstable <=