diff options
author | 2025-04-22 09:18:13 +0100 | |
---|---|---|
committer | 2025-05-09 13:43:07 +0100 | |
commit | a899b7d0673cc7c53545a4c9c30c2c93f2f8cc7d (patch) | |
tree | df204552ff6fde8b0c562ae318140ce93e69f2e1 /scripts/gdb/linux/utils.py | |
parent | arm64/mm: Refactor __set_ptes() and __ptep_get_and_clear() (diff) | |
download | wireguard-linux-a899b7d0673cc7c53545a4c9c30c2c93f2f8cc7d.tar.xz wireguard-linux-a899b7d0673cc7c53545a4c9c30c2c93f2f8cc7d.zip |
arm64: hugetlb: Use __set_ptes_anysz() and __ptep_get_and_clear_anysz()
Refactor the huge_pte helpers to use the new common __set_ptes_anysz()
and __ptep_get_and_clear_anysz() APIs.
This provides 2 benefits; First, when page_table_check=on, hugetlb is
now properly/fully checked. Previously only the first page of a hugetlb
folio was checked. Second, instead of having to call __set_ptes(nr=1)
for each pte in a loop, the whole contiguous batch can now be set in one
go, which enables some efficiencies and cleans up the code.
One detail to note is that huge_ptep_clear_flush() was previously
calling ptep_clear_flush() for a non-contiguous pte (i.e. a pud or pmd
block mapping). This has a couple of disadvantages; first
ptep_clear_flush() calls ptep_get_and_clear() which transparently
handles contpte. Given we only call for non-contiguous ptes, it would be
safe, but a waste of effort. It's preferable to go straight to the layer
below. However, more problematic is that ptep_get_and_clear() is for
PAGE_SIZE entries so it calls page_table_check_pte_clear() and would not
clear the whole hugetlb folio. So let's stop special-casing the non-cont
case and just rely on get_clear_contig_flush() to do the right thing for
non-cont entries.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Tested-by: Luiz Capitulino <luizcap@redhat.com>
Link: https://lore.kernel.org/r/20250422081822.1836315-6-ryan.roberts@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions