All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Subject: [PATCH v3 0/4] mm/hugetlb: Fix CMA parsing, flags and usage accounting
@ 2026-11-06 10:05 Kaitao Cheng
  2026-11-06 10:05 ` [PATCH v3 1/4] mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed input Kaitao Cheng
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Kaitao Cheng @ 2026-11-06 10:05 UTC (permalink / raw)
  To: Muchun Song, Oscar Salvador, David Hildenbrand, Andrew Morton,
	Mike Rapoport, Johannes Weiner, Michal Hocko, Roman Gushchin,
	Shakeel Butt
  Cc: Mani Tofigh, Zi Yan, Mike Kravetz, Baolin Wang, Miaohe Lin,
	Naoya Horiguchi, Frank van der Linden, Chris Down, Joshua Hahn,
	linux-mm, linux-kernel, cgroups, Kaitao Cheng

From: Kaitao Cheng <chengkaitao@kylinos.cn>

This series fixes three independent HugeTLB issues reported by Sashiko
and includes a follow-up cleanup of NR_HUGETLB accounting.

Patch 1 rejects a global hugetlb_cma size following node-specific entries.
This prevents malformed input from overwriting valid per-node reservations
with an incorrectly parsed global size.

Patch 2 preserves persistent folio flags when a failed vmemmap restore
returns a folio to the pool. This retains CMA allocation tracking and
raw hardware poison information, while ensuring transient flags are
cleared before returning the folio.

Patch 3 retains the minimal NR_HUGETLB accounting fix, as suggested by
Muchun Song, to keep it straightforward to backport. It balances the
counter before freeing unused surplus folios during reservation
gathering or after a failed overcommit recheck.

Patch 4 moves NR_HUGETLB node accounting to the underlying folio state
transitions and separates it from memcg statistics. This cleans up
the accounting in the allocation and surplus cleanup paths.

Changes in v3:
- Retain patch 3/3 from v1.
- Fix code alignment.

Changes in v2:
- Patch 2: Preserve persistent flags, clear transient flags, and warn
  about unexpected flags.
- Patch 3: Account at folio state transitions and separate node and
  memcg statistics.

Link to v2:
https://lore.kernel.org/all/20261102024910.31486-1-kaitao.cheng@linux.dev/

Link to v1:
https://lore.kernel.org/all/20261028113319.38544-1-kaitao.cheng@linux.dev/

Kaitao Cheng (4):
  mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed
    input
  mm/hugetlb: Preserve persistent flags when returning folios to the
    pool
  mm/hugetlb: fix NR_HUGETLB accounting for unused surplus folios
  mm/hugetlb: Account NR_HUGETLB at folio state transitions

 mm/hugetlb.c     | 52 +++++++++++++++++++++++++++++++-----------------
 mm/hugetlb_cma.c |  3 +++
 mm/memcontrol.c  |  6 +-----
 3 files changed, 38 insertions(+), 23 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-11-10  2:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 10:05 [PATCH v3 0/4] Subject: [PATCH v3 0/4] mm/hugetlb: Fix CMA parsing, flags and usage accounting Kaitao Cheng
2026-11-06 10:05 ` [PATCH v3 1/4] mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed input Kaitao Cheng
2026-11-06 10:05 ` [PATCH v3 2/4] mm/hugetlb: Preserve persistent flags when returning folios to the pool Kaitao Cheng
2026-11-06 10:05 ` [PATCH v3 3/4] mm/hugetlb: fix NR_HUGETLB accounting for unused surplus folios Kaitao Cheng
2026-11-10  2:37   ` Muchun Song
2026-11-06 10:05 ` [PATCH v3 4/4] mm/hugetlb: Account NR_HUGETLB at folio state transitions Kaitao Cheng
2026-11-10  0:23 ` [PATCH v3 0/4] Subject: [PATCH v3 0/4] mm/hugetlb: Fix CMA parsing, flags and usage accounting Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.