Skip to content

mm/rmap: separate hugetlb rmap handling

David Hildenbrand linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm/rmap: rename hugepage_add* to hugetlb_add*include/linux/rmap.h mm/hugetlb.c mm/migrate.c +1 more+12 -121 reply
2/5mm/rmap: introduce and use hugetlb_remove_rmap()include/linux/rmap.h mm/hugetlb.c mm/rmap.c+15 -116 replies
3/5mm/rmap: introduce and use hugetlb_add_file_rmap()include/linux/rmap.h mm/hugetlb.c mm/migrate.c+11 -40 replies
4/5mm/rmap: introduce and use hugetlb_try_dup_anon_rmap()include/linux/mm.h include/linux/rmap.h mm/hugetlb.c+25 -50 replies
5/5mm/rmap: add hugetlb sanity checksinclude/linux/rmap.h mm/rmap.c+12 -00 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchMuchun Song
1/5R-b
2/5
3/5
4/5
5/5

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 v1 0/5] mm/rmap: separate hugetlb rmap handling

Let's just cleanly separate hugetlb rmap handling from "ordinary" rmap handling, like we already do when adding anon hugetlb folios. We have hugetlb special-casing/checks in the callers in all cases either way already in place: it doesn't make too much sense to call generic-looking functions that end up doing hugetlb specific things from hugetlb special-cases.

This now also means that we won't run into "folio_test_pmd_mappable()" cases for hugetlb, which doesn't make too much sense with gigantic hugetlb folios that are in fact currently only PUD-mappable. Or having a folio_add_file_rmap() function that looks like it clould be used by hugetlb code, but really can't.

This is a stanalone cleanup, but it gets more relevant when adding more rmap batching (we cannot map parts of a hugetlb folio) or changing the way we handle partially-mappable folios as in [1], whereby we'd have to add more hugetlb special casing to keep hugetlb working as is.

If ever something about hugetlb changes that makes them actually partially-mappable folios, we can look into cleanly merging all code paths, not just some.

[1] https://lkml.kernel.org/r/[email protected]

Cc Andrew Morton <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Muchun Song <[email protected]>

David Hildenbrand (5):
mm/rmap: rename hugepage_add* to hugetlb_add* mm/rmap: introduce and use hugetlb_remove_rmap() mm/rmap: introduce and use hugetlb_add_file_rmap() mm/rmap: introduce and use hugetlb_try_dup_anon_rmap() mm/rmap: add hugetlb sanity checks

 include/linux/mm.h   | 12 +++++++++---
 include/linux/rmap.h | 37 +++++++++++++++++++++++++++++++++++--
 mm/hugetlb.c         | 21 ++++++++++-----------
 mm/migrate.c         |  6 +++---
 mm/rmap.c            | 31 ++++++++++++++++++-------------
 5 files changed, 75 insertions(+), 32 deletions(-)

base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86

Signature · 1 line
2.41.0