Skip to content

Commit

Permalink
khugepaged: remove meaningless !pte_present() check in khugepaged_sca…
Browse files Browse the repository at this point in the history
…n_pmd()

We know it must meet the !is_swap_pte() and !pte_none() condition if we
reach here.  Since !is_swap_pte() indicates pte_none() or pte_present()
is met, it's guaranteed that pte must be present here.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Cc: Mike Kravetz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
MiaoheLin authored and torvalds committed May 5, 2021
1 parent 18d24a7 commit 75f8378
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mm/khugepaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,6 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
goto out_unmap;
}
}
if (!pte_present(pteval)) {
result = SCAN_PTE_NON_PRESENT;
goto out_unmap;
}
if (pte_uffd_wp(pteval)) {
/*
* Don't collapse the page if any of the small
Expand Down

0 comments on commit 75f8378

Please sign in to comment.