diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 29501f040568..c47dffdcb246 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -6686,16 +6686,20 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, | |||
6686 | pgoff = pte_to_pgoff(ptent); | 6686 | pgoff = pte_to_pgoff(ptent); |
6687 | 6687 | ||
6688 | /* page is moved even if it's not RSS of this task(page-faulted). */ | 6688 | /* page is moved even if it's not RSS of this task(page-faulted). */ |
6689 | page = find_get_page(mapping, pgoff); | ||
6690 | |||
6691 | #ifdef CONFIG_SWAP | 6689 | #ifdef CONFIG_SWAP |
6692 | /* shmem/tmpfs may report page out on swap: account for that too. */ | 6690 | /* shmem/tmpfs may report page out on swap: account for that too. */ |
6693 | if (radix_tree_exceptional_entry(page)) { | 6691 | if (shmem_mapping(mapping)) { |
6694 | swp_entry_t swap = radix_to_swp_entry(page); | 6692 | page = find_get_entry(mapping, pgoff); |
6695 | if (do_swap_account) | 6693 | if (radix_tree_exceptional_entry(page)) { |
6696 | *entry = swap; | 6694 | swp_entry_t swp = radix_to_swp_entry(page); |
6697 | page = find_get_page(swap_address_space(swap), swap.val); | 6695 | if (do_swap_account) |
6698 | } | 6696 | *entry = swp; |
6697 | page = find_get_page(swap_address_space(swp), swp.val); | ||
6698 | } | ||
6699 | } else | ||
6700 | page = find_get_page(mapping, pgoff); | ||
6701 | #else | ||
6702 | page = find_get_page(mapping, pgoff); | ||
6699 | #endif | 6703 | #endif |
6700 | return page; | 6704 | return page; |
6701 | } | 6705 | } |