Skip to content

mm/debug_vm_pgtable: Enhancements

Gavin Shan linux-mm linux-snps-arc lkml 6 versions – Applied

Status from this message: [merged] mm-debug_vm_pgtable-fix-corrupted-page-flag.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest12 patches 6 repliesApplied 12/12
  2. v512 patches 3 repliesSuperseded
  3. v412 patches 22 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v312 patches30 repliesSuperseded
v212 patches8 repliesSuperseded
v112 patches10 repliesSuperseded

Changes in v6 from the cover letter

* Populate saved page table entry pointers after
they're allocated in init_args() (Anshuman)
* Fix imbalanced preemption count issue by replacing
pte_alloc_mmap() with pte_alloc() in init_args() (syzbot)

Patches in v6 All 12 applied

#Subject and filesSizeRepliesApplied
1/12mm/debug_vm_pgtable: Introduce struct pgtable_debug_argsmm/debug_vm_pgtable.c+269 -10 repliesApplied
2/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in basic testsmm/debug_vm_pgtable.c+24 -260 repliesApplied
3/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in leaf and savewrite testsmm/debug_vm_pgtable.c+16 -160 repliesApplied
4/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in protnone and devmap testsmm/debug_vm_pgtable.c+26 -320 repliesApplied
5/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in soft_dirty and swap testsmm/debug_vm_pgtable.c+23 -250 repliesApplied
6/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in migration and thp testsmm/debug_vm_pgtable.c+17 -190 repliesApplied
7/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in PTE modifying testsmm/debug_vm_pgtable.c+32 -350 repliesApplied
8/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in PMD modifying testsmm/debug_vm_pgtable.c+46 -520 repliesApplied
9/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in PUD modifying testsmm/debug_vm_pgtable.c+48 -780 repliesApplied
10/12mm/debug_vm_pgtable: Use struct pgtable_debug_args in PGD and P4D modifying testsmm/debug_vm_pgtable.c+38 -480 repliesApplied
11/12mm/debug_vm_pgtable: Remove unused codemm/debug_vm_pgtable.c+0 -540 repliesApplied
12/12mm/debug_vm_pgtable: Fix corrupted page flagmm/debug_vm_pgtable.c+51 -40 repliesApplied

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchAnshuman Khandual
1/12R-b
2/12R-b
3/12R-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12R-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 00/12] mm/debug_vm_pgtable: Enhancements

There are couple of issues with current implementations and this series tries to resolve the issues:

(a) All needed information are scattered in variables, passed to various test functions. The code is organized in pretty much relaxed fashion.

(b) The page isn't allocated from buddy during page table entry modifying tests. The page can be invalid, conflicting to the implementations of set_xxx_at() on ARM64. The target page is accessed so that the iCache can be flushed when execution permission is given on ARM64. Besides, the target page can be unmapped and accessing to it causes kernel crash.

"struct pgtable_debug_args" is introduced to address issue (a). For issue (b), the used page is allocated from buddy in page table entry modifying tests. The corresponding tets will be skipped if we fail to allocate the (huge) page. For other test cases, the original page around to kernel symbol (@start_kernel) is still used.

The patches are organized as below. PATCH[2-10] could be combined to one patch, but it will make the review harder:

PATCH[1] introduces "struct pgtable_debug_args" as place holder of all
needed information. With it, the old and new implementation can coexist.
PATCH[2-10] uses "struct pgtable_debug_args" in various test functions. PATCH[11] removes the unused code for old implementation. PATCH[12] fixes the issue of corrupted page flag for ARM64

Changelog
=========
v6:
* Populate saved page table entry pointers after
they're allocated in init_args() (Anshuman)
* Fix imbalanced preemption count issue by replacing
pte_alloc_mmap() with pte_alloc() in init_args() (syzbot)
v5:

   * Pick r-bs from Anshuman and rebase to 5.14.rc4          (Gavin)
   * Use args->start_p4dp to free p4d entries                (Anshuman)
   * Introduce helper to allocate huge page in init_arg()    (Anshuman)
   * Bail early if the allocated page doesn't exist in
     swap_migration_tests() and correct the comments         (Anshuman)
   * Add fixes tag to PATCH[v4 12/12]                        (Christophe)
   * Address misc comments                                   (Anshuman)
v4:
   * Determine the page allocation method according to
     MAX_ORDER                                               (Anshuman)
   * Move existing comments to init_args()                   (Anshuman)
   * Code refactoring as suggested by Anshuman               (Anshuman)

* Improved commit log and add comments for flush_dcache_page()
in PATCH[v4 12/12] (Anshuman)
* Address misc comments (Anshuman)
v3:
* Fix the warning caused by allocating more pages than
(1 << (MAX_ORDER - 1)) in init_args() (syzbot)
* Fix build warning by dropping unused variables in separate
patches (0-day)
* Missed "WARN_ON(!pud_none(pud))" in pud_huge_tests() in
PATCH[v2 09/12] (0-day)
* Fix the subjects for PATCH[05/12] and PATCH[09/12] (Gavin)
v2:
* Rename struct vm_pgtable_debug to struct pgtable_debug_args. The parameter name to various test functions are renamed
to "@args" (Anshuman)
* Code changes as suggested by Anshuman (Anshuman)

Gavin Shan (12):
mm/debug_vm_pgtable: Introduce struct pgtable_debug_args mm/debug_vm_pgtable: Use struct pgtable_debug_args in basic tests mm/debug_vm_pgtable: Use struct pgtable_debug_args in leaf and
savewrite tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in protnone and
devmap tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in soft_dirty and
swap tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in migration and
thp tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in PTE modifying
tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in PMD modifying
tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in PUD modifying
tests
mm/debug_vm_pgtable: Use struct pgtable_debug_args in PGD and P4D
modifying tests
mm/debug_vm_pgtable: Remove unused code mm/debug_vm_pgtable: Fix corrupted page flag

 mm/debug_vm_pgtable.c | 918 +++++++++++++++++++++++++-----------------
 1 file changed, 559 insertions(+), 359 deletions(-)
Signature · 1 line
2.23.0