Skip to content

Commit 89be281

Browse files
ioworker0akpm00
authored andcommitted
mm: clean up is_guard_pte_marker()
Let's simplify the implementation. The current code is redundant as it effectively expands to: is_swap_pte(pte) && is_pte_marker_entry(...) && // from is_pte_marker() is_pte_marker_entry(...) // from is_guard_swp_entry() While a modern compiler could likely optimize this away, let's have clean code and not rely on it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Lance Yang <[email protected]> Reviewed-by: Wei Yang <[email protected]> Reviewed-by: Zi Yan <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Reviewed-by: Dev Jain <[email protected]> Cc: Baolin Wang <[email protected]> Cc: Barry Song <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Kairui Song <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Liam Howlett <[email protected]> Cc: Mariano Pache <[email protected]> Cc: Mika Penttilä <[email protected]> Cc: Ryan Roberts <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0a947c1 commit 89be281

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/madvise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,8 @@ static bool is_valid_guard_vma(struct vm_area_struct *vma, bool allow_locked)
10711071

10721072
static bool is_guard_pte_marker(pte_t ptent)
10731073
{
1074-
return is_pte_marker(ptent) &&
1075-
is_guard_swp_entry(pte_to_swp_entry(ptent));
1074+
return is_swap_pte(ptent) &&
1075+
is_guard_swp_entry(pte_to_swp_entry(ptent));
10761076
}
10771077

10781078
static int guard_install_pud_entry(pud_t *pud, unsigned long addr,

0 commit comments

Comments
 (0)