diff options
author | Matthew Wilcox (Oracle) <[email protected]> | 2020-10-13 16:51:28 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-10-13 18:38:29 -0700 |
commit | 8cf886463ecc621688a9c81c387d0f9ed32e45ea (patch) | |
tree | a4ce853191706a1c3e7a827e36260e4b218e6497 | |
parent | e6e88712e43b7942df451508aafc2f083266f56b (diff) |
proc: optimise smaps for shmem entries
Avoid bumping the refcount on pages when we're only interested in the
swap entries.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Huang Ying <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Matthew Auld <[email protected]>
Cc: William Kucharski <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | fs/proc/task_mmu.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 35172a91148e..a1be198f755c 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -520,16 +520,10 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr, page = device_private_entry_to_page(swpent); } else if (unlikely(IS_ENABLED(CONFIG_SHMEM) && mss->check_shmem_swap && pte_none(*pte))) { - page = find_get_entry(vma->vm_file->f_mapping, + page = xa_load(&vma->vm_file->f_mapping->i_pages, linear_page_index(vma, addr)); - if (!page) - return; - if (xa_is_value(page)) mss->swap += PAGE_SIZE; - else - put_page(page); - return; } |