Interaction between Xen and XFS: stray RW mappings

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Chinner <dgc@...>
Cc: <xfs@...>, Xen-devel <xen-devel@...>, Linux Kernel Mailing List <linux-kernel@...>, Mark Williamson <mark.williamson@...>, Morten Bøg <xen-users@...>, <xfs-masters@...>
Date: Friday, October 12, 2007 - 12:58 pm

Hi Dave & other XFS folk,

I'm tracking down a bug which appears to be a bad interaction between
XFS and Xen.  It looks like XFS is holding RW mappings on free pages,
which Xen is trying to get an exclusive RO mapping on so it can turn
them into pagetables.

I'm assuming the pages are actually free, and this isn't a use after
free problem.  From a quick poke around, the most likely pieces of XFS
code is the stuff in xfs_map.c which creates a virtually contiguous
mapping of pages with vmap, and seems to delay unmapping them.

When pinning a pagetable, Xen tries to eliminate any RW aliases of the
pages its using.  This is generally trivial because pages returned by
get_free_page don't have any mappings aside from the normal kernel
mapping.  High pages, when using CONFIG_HIGHPTE, may have a residual
kmap mapping, so we clear out the kmap cache if we encounter a highpage
in the pagetable.

I guess we could create a special-case interface to do the same thing
with XFS mappings, but it would be nicer to have something more generic.

Is my analysis correct?  Or should XFS not be holding stray mappings? 
Or is there already some kind of generic mechanism I can use to get it
to release its mappings?

Thanks,
    J
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Fri Oct 12, 12:58 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Sun Oct 14, 6:56 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 10:56 am)
Re: Interaction between Xen and XFS: stray RW mappings, Benjamin Herrenschmidt, (Sun Oct 21, 6:16 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 7:28 am)
Re: Interaction between Xen and XFS: stray RW mappings, Dave Airlie, (Sun Oct 21, 8:17 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 7:12 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Sun Oct 14, 7:33 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 12:15 am)
Re: Interaction between Xen and XFS: stray RW mappings, dean gaudet, (Sun Oct 21, 11:18 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 21, 11:34 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:40 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 22, 6:32 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 22, 8:36 pm)
Re: [PATCH] Allow lazy unmapping by taking extra page refere..., Jeremy Fitzhardinge, (Wed Oct 24, 1:08 am)
Re: [PATCH] Allow lazy unmapping by taking extra page refere..., Jeremy Fitzhardinge, (Wed Oct 24, 6:46 pm)
Re: [patch] Re: Interaction between Xen and XFS: stray RW ma..., Jeremy Fitzhardinge, (Tue Oct 23, 10:33 am)
Re: Interaction between Xen and XFS: stray RW mappings, Zachary Amsden, (Mon Oct 22, 8:16 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 3:11 pm)
Re: Interaction between Xen and XFS: stray RW mappings, dean gaudet, (Mon Oct 22, 12:28 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:32 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 22, 12:39 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 22, 2:37 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 8:57 pm)
Re: Interaction between Xen and XFS: stray RW mappings, Nick Piggin, (Mon Oct 15, 3:26 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Sun Oct 14, 11:42 pm)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 15, 12:11 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Mon Oct 15, 12:18 am)
Re: Interaction between Xen and XFS: stray RW mappings, David Chinner, (Mon Oct 15, 12:25 am)
Re: [xfs-masters] Re: Interaction between Xen and XFS: stray..., Christoph Hellwig, (Mon Oct 15, 4:31 am)
Re: Interaction between Xen and XFS: stray RW mappings, Jeremy Fitzhardinge, (Fri Oct 12, 1:08 pm)