Skip to content

Commit 02399c8

Browse files
xzpetertorvalds
authored andcommitted
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]>
1 parent 10c848c commit 02399c8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mm/shmem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,8 @@ unsigned long shmem_swap_usage(struct vm_area_struct *vma)
856856
return swapped << PAGE_SHIFT;
857857

858858
/* Here comes the more involved part */
859-
return shmem_partial_swap_usage(mapping,
860-
linear_page_index(vma, vma->vm_start),
861-
linear_page_index(vma, vma->vm_end));
859+
return shmem_partial_swap_usage(mapping, vma->vm_pgoff,
860+
vma->vm_pgoff + vma_pages(vma));
862861
}
863862

864863
/*

0 commit comments

Comments
 (0)