Skip to content

mm,huge,rmap: unify and speed up compound mapcounts

Hugh Dickins linux-mm lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 25 repliesIn review 2 of 8 applied

Patches in v1 2 of 8 applied

#Subject and filesSizeRepliesApplied
1/3mm,hugetlb: use folio fields in second tail pageinclude/linux/hugetlb.h include/linux/hugetlb_cgroup.h include/linux/mm_types.h +2 more+65 -686 replies
1/3mm,hugetlb: use folio fields in second tail page: fixinclude/linux/mm_types.h+4 -20 replies
1/3mm,thp,rmap: subpages_mapcount of PTE-mapped subpagesDocumentation/mm/transhuge.rst include/linux/mm.h include/linux/rmap.h +2 more+103 -1174 replies
1/3mm,thp,rmap: subpages_mapcount of PTE-mapped subpages: fixmm/rmap.c+1 -12 replies
2/3mm,thp,rmap: simplify compound page mapcount handlingDocumentation/mm/transhuge.rst include/linux/mm.h include/linux/mm_types.h +10 more+194 -2612 repliesApplied
2/3mm,thp,rmap: subpages_mapcount COMPOUND_MAPPED if PMD-mappedDocumentation/mm/transhuge.rst include/linux/mm.h include/linux/rmap.h +2 more+52 -1122 replies
3/3mm,thp,rmap: lock_compound_mapcounts() on THP mapcountsDocumentation/mm/transhuge.rst include/linux/rmap.h mm/huge_memory.c +1 more+204 -1623 repliesApplied
3/3mm,thp,rmap: clean up the end of __split_huge_pmd_locked()mm/huge_memory.c+5 -101 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKirill A. Shutemov
SeriesA-b A-b A-b
1/3A-b A-b
1/3A-b A-b
1/3A-b A-b
1/3A-b A-b
2/3A-b A-b
2/3A-b A-b
3/3A-b A-b
3/3A-b A-b

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

Read the v1 thread

Cover letter [PATCH 0/3] mm,huge,rmap: unify and speed up compound mapcounts

I had intended to send just a self-explanatory 1/2 and 2/2 against 6.1-rc3 on Monday; but checked for clashes with linux-next (mainly mm-unstable) just before sending, and fuzz in mm_types.h revealed not just a clash with Sidhartha's series, but also that I had missed the hugetlb usage of tail page->private, problematic for me on 32-bit.

So that series was slightly broken; and although it would probably have been easy to fix with a "SUBPAGE_INDEX_SUBPOOL = 2" patch, that would not have moved us forward very well. So this series is against next-20221102 (and hopefully later nexts), with a preparatory 1/3 to rejig the hugetlb tail private usage, on top of Sidhartha's.

1/3 mm,hugetlb: use folio fields in second tail page 2/3 mm,thp,rmap: simplify compound page mapcount handling 3/3 mm,thp,rmap: lock_compound_mapcounts() on THP mapcounts

2/3 and 3/3 can almost be applied cleanly to 6.1-rc3 (okay when you are on 64-bit): just a couple of easily resolved rejects.

 Documentation/mm/transhuge.rst |  34 +---
 include/linux/hugetlb.h        |  23 +--
 include/linux/hugetlb_cgroup.h |  31 +--
 include/linux/mm.h             |  85 ++++++---
 include/linux/mm_types.h       |  91 ++++++---
 include/linux/page-flags.h     |  21 --
 include/linux/rmap.h           |  12 +-
 mm/Kconfig                     |   2 +-
 mm/debug.c                     |   5 +-
 mm/folio-compat.c              |   6 -
 mm/huge_memory.c               |  37 +---
 mm/hugetlb.c                   |   2 +
 mm/khugepaged.c                |  11 +-
 mm/memory-failure.c            |   5 +-
 mm/page_alloc.c                |  27 +--
 mm/rmap.c                      | 359 ++++++++++++++++++++---------------
 mm/util.c                      |  79 --------
 17 files changed, 401 insertions(+), 429 deletions(-)

Hugh