Skip to content

refactor and merge PTE scanning logic

Lance Yang linux-mm lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 19 repliesIn review
  2. v23 patches 4 repliesSuperseded
  3. v12 patches 15 repliesSuperseded

Changes in v3 from the cover letter

- #02 Collect Reviewed-by from Wei and Dev - thanks!
- #03 Use vm_normal_folio() and drop struct page altogether (per Dev)
- #03 Move the cc parameter to the end (per Dev)
- https://lore.kernel.org/linux-mm/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm/khugepaged: optimize PTE scanning with if-else-if-else-if chainmm/khugepaged.c+4 -85 replies
2/3mm/khugepaged: use VM_WARN_ON_FOLIO instead of VM_BUG_ON_FOLIO for non-anon foliosmm/khugepaged.c+6 -11 reply
3/3mm/khugepaged: merge PTE scanning logic into a new helpermm/khugepaged.c+130 -11313 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchWei YangDev JainZi Yan
1/3R-b R-b R-b
2/3R-b R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH mm-new v3 0/3] refactor and merge PTE scanning logic

Hi all,

This series cleans up the almost-duplicated PTE scanning logic in the collapse path.

The first one is a preparatory step that refactors both loops to use a single if-else-if-else-if chain for checking disjoint PTEs.

The second one replaces VM_BUG_ON_FOLIO() with a more graceful VM_WARN_ON_FOLIO() for handling non-anonymous folios.

The last one then extracts the common logic into a shared helper.

Thanks,
Lance

---
This series applies on top of patch[1], which is based on mm-new.
[1] https://lore.kernel.org/linux-mm/[email protected]

v2 -> v3:
- #02 Collect Reviewed-by from Wei and Dev - thanks!
- #03 Use vm_normal_folio() and drop struct page altogether (per Dev)
- #03 Move the cc parameter to the end (per Dev)
- https://lore.kernel.org/linux-mm/[email protected]

v1 -> v2:
- #01 Update the changelog (per Dev)
- #01 Collect Reviewed-by from Wei, Dev and Zi - thanks!
- #03 Make more of the scanning logic common between scan_pmd() and _isolate() (per Dev)
- https://lore.kernel.org/linux-mm/[email protected]

Lance Yang (3):
mm/khugepaged: optimize PTE scanning with if-else-if-else-if chain mm/khugepaged: use VM_WARN_ON_FOLIO instead of VM_BUG_ON_FOLIO for
non-anon folios
mm/khugepaged: merge PTE scanning logic into a new helper

 mm/khugepaged.c | 242 ++++++++++++++++++++++++++----------------------
 1 file changed, 130 insertions(+), 112 deletions(-)
Signature · 1 line
2.49.0