]> Git Repo - linux.git/commit
mm: hugetlb: kill set_huge_swap_pte_at()
authorQi Zheng <[email protected]>
Sun, 26 Jun 2022 14:57:17 +0000 (22:57 +0800)
committerakpm <[email protected]>
Mon, 4 Jul 2022 01:08:50 +0000 (18:08 -0700)
commit18f3962953e40401b7ed98e8524167282c3e626e
tree3188a794c7eb410b550c04531a51ec163911fab1
parentade63b419c4e8d27f0642804b6c8c7a76ffc18ac
mm: hugetlb: kill set_huge_swap_pte_at()

Commit e5251fd43007 ("mm/hugetlb: introduce set_huge_swap_pte_at()
helper") add set_huge_swap_pte_at() to handle swap entries on
architectures that support hugepages consisting of contiguous ptes.  And
currently the set_huge_swap_pte_at() is only overridden by arm64.

set_huge_swap_pte_at() provide a sz parameter to help determine the number
of entries to be updated.  But in fact, all hugetlb swap entries contain
pfn information, so we can find the corresponding folio through the pfn
recorded in the swap entry, then the folio_size() is the number of entries
that need to be updated.

And considering that users will easily cause bugs by ignoring the
difference between set_huge_swap_pte_at() and set_huge_pte_at().  Let's
handle swap entries in set_huge_pte_at() and remove the
set_huge_swap_pte_at(), then we can call set_huge_pte_at() anywhere, which
simplifies our coding.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Qi Zheng <[email protected]>
Acked-by: Muchun Song <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
arch/arm64/include/asm/hugetlb.h
arch/arm64/mm/hugetlbpage.c
include/linux/hugetlb.h
mm/hugetlb.c
mm/rmap.c
This page took 0.062782 seconds and 4 git commands to generate.