Re: [VFS] move active filesystem

Stephen C. Tweedie (sct@redhat.com)
Wed, 26 May 1999 17:14:47 +0100 (BST)


Hi,

On Wed, 19 May 1999 18:28:04 +0200 (CEST), Andrea Arcangeli
<andrea@suse.de> said:

> BTW, allowing dirty pages in the page cache may avoid I/O to disk but
> won't avoid memcpy data to the page cache even if the page cache was just
> uptdate. So I am convinced right now update_shared_mappings() is the right
> thing to do and it's not an dirty hack. It's only a not very efficient
> implementation that has to play with pgd/pmd/pte because we don't have
> enough information (yet) from the pagemap.

To do it correctly, you need to do much more than just play with the
page tables in the way your current update_shared_mappings() does,
because the page can be at different addresses in different VAs. For
MAP_SHARED pages we have a list of all the VAs, but for MAP_PRIVATE
pages we do not, and mremap() can still cause a shared private page
(eg. data pages after fork()) to appear at different locations in
different mms.

Dealing with that is a little tricky, but you can do it by keeping lists
of "related" vmas, based on overlaps between the original addresses of
the vmas, not their current addresses. Private page sharing can only
occur when the original address of the vmas overlapped, and that gives
us an invariant to check for over mremap().

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/