diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-22 08:00:54 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-22 08:00:54 -0700 |
| commit | cab971db76406075a03df304db139fd4b7193a96 (patch) | |
| tree | 6a28983248fae394186c361fd1e69c41a1831051 /include/linux | |
| parent | d61ae266b334dfdd64697d4d5b5df9e3440666d8 (diff) | |
[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.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mm.h | 1 | ||||
| -rw-r--r-- | include/linux/rmap.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 56ccfb5ec82a..48781c75e53b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -185,6 +185,7 @@ struct page { struct pte_chain *chain;/* Reverse pte mapping pointer. * protected by PG_chainlock */ pte_addr_t direct; + unsigned int mapcount; /* Count ptes mapped into mms */ } pte; unsigned long private; /* Mapping-private opaque data: * usually used for buffer_heads diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 3d6bcf2b09b9..65e0f74f5390 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -27,6 +27,7 @@ static inline void pte_chain_free(struct pte_chain *pte_chain) struct pte_chain * fastcall page_add_rmap(struct page *, pte_t *, struct pte_chain *); +void fastcall page_add_file_rmap(struct page *); void fastcall page_remove_rmap(struct page *, pte_t *); /* |
