]> git.hungrycats.org Git - linux/commit
[PATCH] rmap 7 object-based rmap
authorAndrew Morton <akpm@osdl.org>
Sat, 22 May 2004 15:00:54 +0000 (08:00 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 22 May 2004 15:00:54 +0000 (08:00 -0700)
commitcab971db76406075a03df304db139fd4b7193a96
tree6a28983248fae394186c361fd1e69c41a1831051
parentd61ae266b334dfdd64697d4d5b5df9e3440666d8
[PATCH] rmap 7 object-based rmap

From: Hugh Dickins <hugh@veritas.com>

Dave McCracken's object-based reverse mapping scheme for file pages: why
build up and tear down chains of pte pointers for file pages, when
page->mapping has i_mmap and i_mmap_shared lists of all the vmas which
might contain that page, and it appears at one deterministic position
within the vma (unless vma is nonlinear - see next patch)?

Has some drawbacks: more work to locate the ptes from page_referenced and
try_to_unmap, especially if the i_mmap lists contain a lot of vmas covering
different ranges; has to down_trylock the i_shared_sem, and hope that
doesn't fail too often.  But attractive in that it uses less lowmem, and
shifts the rmap burden away from the hot paths, to swapout.

Hybrid scheme for the moment: carry on with pte_chains for anonymous pages,
that's unchanged; but file pages keep mapcount in the pte union of struct
page, where anonymous pages keep chain pointer or direct pte address: so
page_mapped(page) works on both.

Hugh massaged it a little: distinct page_add_file_rmap entry point; list
searches check rss so as not to waste time on mms fully swapped out; check
mapcount to terminate once all ptes have been found; and a WARN_ON if
page_referenced should have but couldn't find all the ptes.
include/asm-ia64/pgtable.h
include/linux/mm.h
include/linux/rmap.h
mm/fremap.c
mm/memory.c
mm/mremap.c
mm/rmap.c