aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2016-12-12 19:43:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-12 21:55:08 -0500
commitdbc446b88e7041cb1d076e51726ccee497cb6ee3 (patch)
tree869be21f6babac4c47c9ee607004620ffb790f5e /mm/filemap.c
parent14b468791fa955d442f962fdf5207dfd39a131c8 (diff)
mm: workingset: restore refault tracking for single-page files
Shadow entries in the page cache used to be accounted behind the radix tree implementation's back in the upper bits of node->count, and the radix tree code extending a single-entry tree with a shadow entry in root->rnode would corrupt that counter. As a result, we could not put shadow entries at index 0 if the tree didn't have any other entries, and that means no refault detection for any single-page file. Now that the shadow entries are tracked natively in the radix tree's exceptional counter, this is no longer necessary. Extending and shrinking the tree from and to single entries in root->rnode now does the right thing when the entry is exceptional, remove that limitation. Link: http://lkml.kernel.org/r/20161117193244.GF23430@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Jan Kara <jack@suse.cz> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Hugh Dickins <hughd@google.com> Cc: Matthew Wilcox <mawilcox@linuxonhyperv.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index dc3e5fce0b7b..5b4dd03130da 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -167,14 +167,7 @@ static void page_cache_tree_delete(struct address_space *mapping,
167 __radix_tree_lookup(&mapping->page_tree, page->index + i, 167 __radix_tree_lookup(&mapping->page_tree, page->index + i,
168 &node, &slot); 168 &node, &slot);
169 169
170 if (!node) { 170 VM_BUG_ON_PAGE(!node && nr != 1, page);
171 VM_BUG_ON_PAGE(nr != 1, page);
172 /*
173 * We need a node to properly account shadow
174 * entries. Don't plant any without. XXX
175 */
176 shadow = NULL;
177 }
178 171
179 radix_tree_clear_tags(&mapping->page_tree, node, slot); 172 radix_tree_clear_tags(&mapping->page_tree, node, slot);
180 __radix_tree_replace(&mapping->page_tree, node, slot, shadow, 173 __radix_tree_replace(&mapping->page_tree, node, slot, shadow,