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

[Xen-changelog] [linux-2.6.18-xen] xfs: eagerly remove vmap mappings to avoid upsetting Xen



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1192609443 -3600
# Node ID 9bf1ddd0f6bf57684c5b0307a43ea381c45f5147
# Parent  ff61d4335750af17daccbadfa5478e9200d1e09d
xfs: eagerly remove vmap mappings to avoid upsetting Xen
XFS leaves stray mappings around when it vmaps memory to make it
virtually contigious.  This upsets Xen if one of those pages is being
recycled into a pagetable, since it finds an extra writable mapping of
the page.

This patch solves the problem in a brute force way, by making XFS
always eagerly unmap its mappings.  David Chinner says this shouldn't
have any performance impact on filesystems with default block sizes;
it will only affect filesystems with large block sizes.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
Acked-by: David Chinner <dgc@xxxxxxx>
Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Cc: XFS masters <xfs-masters@xxxxxxxxxxx>
Cc: Stable kernel <stable@xxxxxxxxxx>
Cc: Morten =?utf-8?q?B=C3=B8geskov?= <xen-users@xxxxxxxxxxxxxxxxxx>
Cc: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
---


 fs/xfs/linux-2.6/xfs_buf.c |   13 +++++++++++++
 1 files changed, 13 insertions(+)

diff -r ff61d4335750 -r 9bf1ddd0f6bf fs/xfs/linux-2.6/xfs_buf.c
--- a/fs/xfs/linux-2.6/xfs_buf.c        Tue Oct 16 09:34:20 2007 +0100
+++ b/fs/xfs/linux-2.6/xfs_buf.c        Wed Oct 17 09:24:03 2007 +0100
@@ -181,6 +181,19 @@ free_address(
        void            *addr)
 {
        a_list_t        *aentry;
+
+#ifdef CONFIG_XEN
+       /*
+        * Xen needs to be able to make sure it can get an exclusive
+        * RO mapping of pages it wants to turn into a pagetable.  If
+        * a newly allocated page is also still being vmap()ed by xfs,
+        * it will cause pagetable construction to fail.  This is a
+        * quick workaround to always eagerly unmap pages so that Xen
+        * is happy.
+        */
+       vunmap(addr);
+       return;
+#endif
 
        aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
        if (likely(aentry)) {

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