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] PoD, hap: Fix logdirty mode when using ha

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] PoD, hap: Fix logdirty mode when using hardware assisted paging
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 20 Jan 2011 05:05:12 -0800
Delivery-date: Thu, 20 Jan 2011 05:05:36 -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 George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1295274541 0
# Node ID 3decd02e0b18ae21fb926c6bad96a4cd02c48272
# Parent  97ab84aca65cdcbce2ddccc51629fb24adb056cf
PoD,hap: Fix logdirty mode when using hardware assisted paging

When writing a writable p2m entry for a pfn, we need to mark the pfn
dirty to avoid corruption when doing live migration.

Marking the page dirty exposes another issue, where there are
excessive sweeps for zero pages if there's a mismatch between PoD
entries and cache entries.  Only sweep for zero pages if we actually
need more memory.

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

diff -r 97ab84aca65c -r 3decd02e0b18 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Mon Jan 17 14:24:13 2011 +0000
+++ b/xen/arch/x86/mm/p2m.c     Mon Jan 17 14:29:01 2011 +0000
@@ -1142,14 +1142,22 @@ p2m_pod_demand_populate(struct p2m_domai
         return 0;
     }
 
-    /* If we're low, start a sweep */
-    if ( order == 9 && page_list_empty(&p2m->pod.super) )
-        p2m_pod_emergency_sweep_super(p2m);
-
-    if ( page_list_empty(&p2m->pod.single) &&
-         ( ( order == 0 )
-           || (order == 9 && page_list_empty(&p2m->pod.super) ) ) )
-        p2m_pod_emergency_sweep(p2m);
+    /* Once we've ballooned down enough that we can fill the remaining
+     * PoD entries from the cache, don't sweep even if the particular
+     * list we want to use is empty: that can lead to thrashing zero pages 
+     * through the cache for no good reason.  */
+    if ( p2m->pod.entry_count > p2m->pod.count )
+    {
+
+        /* If we're low, start a sweep */
+        if ( order == 9 && page_list_empty(&p2m->pod.super) )
+            p2m_pod_emergency_sweep_super(p2m);
+
+        if ( page_list_empty(&p2m->pod.single) &&
+             ( ( order == 0 )
+               || (order == 9 && page_list_empty(&p2m->pod.super) ) ) )
+            p2m_pod_emergency_sweep(p2m);
+    }
 
     /* Keep track of the highest gfn demand-populated by a guest fault */
     if ( q == p2m_guest && gfn > p2m->pod.max_guest )
@@ -1176,7 +1184,10 @@ p2m_pod_demand_populate(struct p2m_domai
     set_p2m_entry(p2m, gfn_aligned, mfn, order, p2m_ram_rw, 
p2m->default_access);
 
     for( i = 0; i < (1UL << order); i++ )
+    {
         set_gpfn_from_mfn(mfn_x(mfn) + i, gfn_aligned + i);
+        paging_mark_dirty(d, mfn_x(mfn) + i);
+    }
     
     p2m->pod.entry_count -= (1 << order); /* Lock: p2m */
     BUG_ON(p2m->pod.entry_count < 0);

_______________________________________________
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] PoD, hap: Fix logdirty mode when using hardware assisted paging, Xen patchbot-unstable <=