diff options
author | Peter Xu <[email protected]> | 2021-11-05 13:36:02 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-11-06 13:30:33 -0700 |
commit | 02399c88024f4b7e6c43b3d4aa39c75af0069e17 (patch) | |
tree | 1045b0c021c2cfad34030505ceb2ccc0093281db | |
parent | 10c848c8b4805ff026018bfb2b3dedd90e7b0cea (diff) |
mm/smaps: use vma->vm_pgoff directly when counting partial swap
As it's trying to cover the whole vma anyways, use direct vm_pgoff value
and vma_pages() rather than linear_page_index.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Peter Xu <[email protected]>
Reviewed-by: Vlastimil Babka <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/shmem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index b5860f4a2738..7cd976b588ff 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -856,9 +856,8 @@ unsigned long shmem_swap_usage(struct vm_area_struct *vma) return swapped << PAGE_SHIFT; /* Here comes the more involved part */ - return shmem_partial_swap_usage(mapping, - linear_page_index(vma, vma->vm_start), - linear_page_index(vma, vma->vm_end)); + return shmem_partial_swap_usage(mapping, vma->vm_pgoff, + vma->vm_pgoff + vma_pages(vma)); } /* |