aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mincore.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-09-19 17:46:07 +0300
committerPekka Enberg <penberg@kernel.org>2011-09-19 17:46:07 +0300
commitd20bbfab01802e195a50435940f7e4aa747c217c (patch)
tree82b0007e33c083050a4e60a49dbb2f5477b4c99d /mm/mincore.c
parentslub: doc: update the slabinfo.c file path (diff)
parentslub: explicitly document position of inserting slab to partial list (diff)
downloadlinux-dev-d20bbfab01802e195a50435940f7e4aa747c217c.tar.xz
linux-dev-d20bbfab01802e195a50435940f7e4aa747c217c.zip
Merge branch 'slab/urgent' into slab/next
Diffstat (limited to 'mm/mincore.c')
-rw-r--r--mm/mincore.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/mincore.c b/mm/mincore.c
index a4e6b9d75c76..636a86876ff2 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -69,12 +69,15 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
* file will not get a swp_entry_t in its pte, but rather it is like
* any other file mapping (ie. marked !present and faulted in with
* tmpfs's .fault). So swapped out tmpfs mappings are tested here.
- *
- * However when tmpfs moves the page from pagecache and into swapcache,
- * it is still in core, but the find_get_page below won't find it.
- * No big deal, but make a note of it.
*/
page = find_get_page(mapping, pgoff);
+#ifdef CONFIG_SWAP
+ /* shmem/tmpfs may return swap: account for swapcache page too. */
+ if (radix_tree_exceptional_entry(page)) {
+ swp_entry_t swap = radix_to_swp_entry(page);
+ page = find_get_page(&swapper_space, swap.val);
+ }
+#endif
if (page) {
present = PageUptodate(page);
page_cache_release(page);