From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, "Andi Kleen" <ak@suse.de>,
"Andrew Morton" <akpm@linux-foundation.org>,
virtualization@lists.osdl.org, xen-devel@lists.xensource.com,
"Chris Wright" <chrisw@sous-sol.org>,
"Keir Fraser" <keir@xensource.com>,
"Stable Kernel" <stable@kernel.org>,
"David Chinner" <dgc@sgi.com>,
"Nick Piggin" <nickpiggin@yahoo.com.au>,
"XFS masters" <xfs-masters@oss.sgi.com>,
"Morten Bøgeskov" <xen-users@morten.bogeskov.dk>,
"Mark Williamson" <mark.williamson@cl.cam.ac.uk>
Subject: [PATCH 12/12] xfs: eagerly remove vmap mappings to avoid upsetting Xen
Date: Mon, 15 Oct 2007 13:48:52 -0700 [thread overview]
Message-ID: <20071015210115.506967748@goop.org> (raw)
In-Reply-To: 20071015204840.074767068@goop.org
[-- Attachment #1: xen-xfs-unmap.patch --]
[-- Type: text/plain, Size: 1587 bytes --]
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@xensource.com>
Cc: David Chinner <dgc@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: XFS masters <xfs-masters@oss.sgi.com>
Cc: Stable kernel <stable@kernel.org>
Cc: Morten =?utf-8?q?B=C3=B8geskov?= <xen-users@morten.bogeskov.dk>
Cc: Mark Williamson <mark.williamson@cl.cam.ac.uk>
---
fs/xfs/linux-2.6/xfs_buf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
===================================================================
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -186,6 +186,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)) {
--
next prev parent reply other threads:[~2007-10-15 21:50 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-15 20:48 [PATCH 00/12] xen/paravirt_ops patches for 2.6.24 Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 01/12] paravirt: refactor struct paravirt_ops into smaller pv_*_ops Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 02/12] paravirt: clean up lazy mode handling Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 03/12] remove dead code in pgtable_cache_init Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 04/12] Clean up duplicate includes in arch/i386/xen/ Jeremy Fitzhardinge
2007-10-15 21:58 ` Jesper Juhl
2007-10-15 20:48 ` [PATCH 05/12] xen: yield to IPI target if necessary Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 06/12] xen: add batch completion callbacks Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 07/12] xen: deal with stale cr3 values when unpinning pagetables Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 08/12] xen: lock pte pages while pinning/unpinning Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 09/12] xen: ask the hypervisor how much space it needs reserved Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 10/12] xen: fix incorrect vcpu_register_vcpu_info hypercall argument Jeremy Fitzhardinge
2007-10-15 20:48 ` [PATCH 11/12] xen: add some debug output for failed multicalls Jeremy Fitzhardinge
2007-10-15 20:48 ` Jeremy Fitzhardinge [this message]
2007-10-15 23:04 ` [PATCH 12/12] xfs: eagerly remove vmap mappings to avoid upsetting Xen David Chinner
2007-10-15 21:54 ` [stable] [PATCH 00/12] xen/paravirt_ops patches for 2.6.24 Greg KH
2007-10-15 21:59 ` Jeremy Fitzhardinge
2007-10-15 22:03 ` Andi Kleen
2007-10-15 23:48 ` Zachary Amsden
2007-11-13 23:22 ` Greg KH
2007-11-13 23:53 ` Andi Kleen
2007-11-14 0:00 ` Greg KH
2007-11-14 18:40 ` Jeremy Fitzhardinge
2007-11-14 19:03 ` Greg KH
2007-11-14 19:53 ` Jeremy Fitzhardinge
2007-11-14 22:01 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071015210115.506967748@goop.org \
--to=jeremy@goop.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=chrisw@sous-sol.org \
--cc=dgc@sgi.com \
--cc=keir@xensource.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.williamson@cl.cam.ac.uk \
--cc=nickpiggin@yahoo.com.au \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
--cc=xen-users@morten.bogeskov.dk \
--cc=xfs-masters@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox