xfs
[Top] [All Lists]

Re: Review: fix mapping invalidation callouts

To: David Chinner <dgc@xxxxxxx>
Subject: Re: Review: fix mapping invalidation callouts
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 8 Jan 2007 09:09:16 +0000
Cc: xfs-dev@xxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <20070108040309.GX33919298@melbourne.sgi.com>
References: <20070108040309.GX33919298@melbourne.sgi.com>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
On Mon, Jan 08, 2007 at 03:03:09PM +1100, David Chinner wrote:
> With the recent cancel_dirty_page() changes, a warning was
> added if we cancel a dirty page that is still mapped into
> the page tables.
> This happens in XFS from fs_tosspages() and fs_flushinval_pages()
> because they call truncate_inode_pages().
> 
> truncate_inode_pages() does not invalidate existing page mappings;
> it is expected taht this is called only when truncating the file
> or destroying the inode and on both these cases there can be
> no mapped ptes. However, we call this when doing direct I/O writes
> to remove pages from the page cache. As a result, we can rip
> a page from the page cache that still has mappings attached.
> 
> The correct fix is to use invalidate_inode_pages2_range() instead
> of truncate_inode_pages(). They essentially do the same thing, but
> the former also removes any pte mappings before removing the page
> from the page cache.
> 
> Comments?

Generally looks good.  But I feel a little cautios about changes in this
area, so we should throw all possible test loads at this before commiting
it.


<Prev in Thread] Current Thread [Next in Thread>