linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] mm/hugetlb: Refactor hugetlb allocation resv accounting
@ 2025-01-07 20:39 Peter Xu
  2025-01-07 20:39 ` [PATCH v2 1/7] mm/hugetlb: Fix avoid_reserve to allow taking folio from subpool Peter Xu
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Peter Xu @ 2025-01-07 20:39 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Breno Leitao, Rik van Riel, Muchun Song, Naoya Horiguchi,
	Roman Gushchin, Ackerley Tng, Andrew Morton, peterx,
	Oscar Salvador

[based on akpm/mm-unstable, latest ca95745c20ad, of Jan 7th 2025]

v2:
- Rebase to latest mm-unstable
- Added R-b and T-b for Ackerley on patch 1

  (Ackerley: I was conservative on the tags here to only attach them in
   patch 1, even though it seems you mentioned you agree/tested with the
   whole series.  Please feel free to provide your tag again on the cover
   letter if you want, thanks)

This is a follow up on Ackerley's series here as replacement:

https://lore.kernel.org/r/cover.1728684491.git.ackerleytng@google.com

The goal of this series is to cleanup hugetlb resv accounting, especially
during folio allocation, to decouple a few things:

  - Hugetlb folios v.s. Hugetlbfs: IOW, the hope is in the future hugetlb
    folios can be allocated completely without hugetlbfs.

  - Decouple VMA v.s. hugetlb folio allocations: allocating a hugetlb folio
    should not always require a hugetlbfs VMA.  For example, either it got
    allocated from the inode level (see hugetlbfs_fallocate() where it used
    a pesudo VMA for allocation), or it can be allocated by other kernel
    subsystems.

It paves way for other users to allocate hugetlb folios out of either
system reservations, or subpools (instead of hugetlbfs, as a file system).
For longer term, this prepares hugetlb as a separate concept versus
hugetlbfs, so that hugetlb folios can be allocated by not only hugetlbfs
and other things.

Tests I've done:

- I had a reproducer in patch 1 for the bug I found, this will start to
  work after patch 1 or the whole set applied.

- Hugetlb regression tests (on x86_64 2MBs), includes:

  - All vmtests on hugetlbfs

  - libhugetlbfs test suite (which may fail some tests, but no new failures
    will be introduced by this series, so all such failures happen before
    this series so shouldn't be relevant).

Comments welcomed, thanks.

Peter Xu (7):
  mm/hugetlb: Fix avoid_reserve to allow taking folio from subpool
  mm/hugetlb: Stop using avoid_reserve flag in fork()
  mm/hugetlb: Rename avoid_reserve to cow_from_owner
  mm/hugetlb: Clean up map/global resv accounting when allocate
  mm/hugetlb: Simplify vma_has_reserves()
  mm/hugetlb: Drop vma_has_reserves()
  mm/hugetlb: Unify restore reserve accounting for new allocations

 fs/hugetlbfs/inode.c    |   2 +-
 include/linux/hugetlb.h |   4 +-
 mm/hugetlb.c            | 237 ++++++++++++++++++----------------------
 3 files changed, 107 insertions(+), 136 deletions(-)

-- 
2.47.0



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-01-16 14:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07 20:39 [PATCH v2 0/7] mm/hugetlb: Refactor hugetlb allocation resv accounting Peter Xu
2025-01-07 20:39 ` [PATCH v2 1/7] mm/hugetlb: Fix avoid_reserve to allow taking folio from subpool Peter Xu
2025-01-13 11:02   ` Oscar Salvador
2025-01-07 20:39 ` [PATCH v2 2/7] mm/hugetlb: Stop using avoid_reserve flag in fork() Peter Xu
2025-01-13 11:05   ` Oscar Salvador
2025-01-07 20:39 ` [PATCH v2 3/7] mm/hugetlb: Rename avoid_reserve to cow_from_owner Peter Xu
2025-01-13 11:20   ` Oscar Salvador
2025-01-13 16:19     ` Peter Xu
2025-01-16 10:15       ` Oscar Salvador
2025-01-16 14:26         ` Peter Xu
2025-01-07 20:39 ` [PATCH v2 4/7] mm/hugetlb: Clean up map/global resv accounting when allocate Peter Xu
2025-01-13 22:57   ` Ackerley Tng
2025-01-14 18:25     ` Peter Xu
2025-01-07 20:40 ` [PATCH v2 5/7] mm/hugetlb: Simplify vma_has_reserves() Peter Xu
2025-01-07 20:40 ` [PATCH v2 6/7] mm/hugetlb: Drop vma_has_reserves() Peter Xu
2025-01-07 20:40 ` [PATCH v2 7/7] mm/hugetlb: Unify restore reserve accounting for new allocations Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox