Thread (14 messages) read the whole thread 14 messages, 5 authors, 2023-09-21

Re: [PATCH] mm: hugetlb: kill set_huge_swap_pte_at()

From: Ryan Roberts <ryan.roberts@arm.com>
Date: 2023-09-21 17:07:34
Also in: linux-mm, lkml

On 26/06/2022 15:57, Qi Zheng wrote:
The 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.

The 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.

Signed-off-by: Qi Zheng <redacted>
Hi,

FYI, I discovered a bug in v6.6-rc1 that causes a kernel panic, which I believe
is caused by this change. I've posted a fix along with a detailed explanation at
[1].

[1]
https://lore.kernel.org/linux-arm-kernel/20230921162007.1630149-1-ryan.roberts@arm.com/ (local)

Thanks,
Ryan


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help