summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2021-11-05 13:36:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-06 13:30:33 -0700
commit230100321518a4e3a027b3b1b7e93b3e02324def (patch)
tree07e4a5bd09f430ee6f4a73a1700a612956ce99d0 /lib
parent02399c88024f4b7e6c43b3d4aa39c75af0069e17 (diff)
mm/smaps: simplify shmem handling of pte holes
Firstly, check_shmem_swap variable is actually not necessary, because it's always set with pte_hole hook; checking each would work. Meanwhile, the check within smaps_pte_entry is not easy to follow. E.g., pte_none() check is not needed as "!pte_present && !is_swap_pte" is the same. Since at it, use the pte_hole() helper rather than dup the page cache lookup. Still keep the CONFIG_SHMEM part so the code can be optimized to nop for !SHMEM. There will be a very slight functional change in smaps_pte_entry(), that for !SHMEM we'll return early for pte_none (before checking page==NULL), but that's even nicer. Link: https://lkml.kernel.org/r/20210917164756.8586-4-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions