Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm/hugetlb: Fix CMA parsing, flags and usage accounting
@ 2026-11-02  2:49 Kaitao Cheng
  2026-11-02  2:49 ` [PATCH v2 1/3] mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed input Kaitao Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kaitao Cheng @ 2026-11-02  2:49 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

This series fixes three independent HugeTLB issues reported by Sashiko,
covering CMA parameter parsing, persistent folio flags, and NR_HUGETLB
accounting on allocation rollback.

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 moves NR_HUGETLB node accounting to the underlying folio state
transitions and separates it from memcg statistics. This keeps the
counter balanced when surplus folios are freed during reservation
gathering or after a failed overcommit recheck.


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 v1:
https://lore.kernel.org/all/20261028113319.38544-1-kaitao.cheng@linux.dev/

Kaitao Cheng (3):
  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 surplus folios

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

-- 
2.54.0 (Apple Git-157)



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

end of thread, other threads:[~2026-11-02  8:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02  2:49 [PATCH v2 0/3] mm/hugetlb: Fix CMA parsing, flags and usage accounting Kaitao Cheng
2026-11-02  2:49 ` [PATCH v2 1/3] mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed input Kaitao Cheng
2026-11-02  2:49 ` [PATCH v2 2/3] mm/hugetlb: Preserve persistent flags when returning folios to the pool Kaitao Cheng
2026-11-02  3:10   ` Muchun Song
2026-11-02  4:03   ` Zi Yan
2026-11-02  8:07   ` Qi Zheng
2026-11-02  2:49 ` [PATCH v2 3/3] mm/hugetlb: Fix NR_HUGETLB accounting for surplus folios Kaitao Cheng
2026-11-02  3:23   ` Muchun Song

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