Re: [PATCH v3 09/11] mm/cma: centralize CMA pageblock initialization

From: Qi Zheng

Date: Mon Nov 23 2026 - 03:15:07 EST




On 11/20/26 6:08 PM, Muchun Song wrote:
Early CMA reservations currently require callers to maintain CMA state.
This exposes internal bookkeeping requirements and splits responsibility
for the same area between CMA and its users.

Make CMA fully responsible for the state of early reservations. Pages
already handed to a caller remain owned by that caller if activation
fails, so keep their managed-page accounting intact regardless of whether
CMA retains the rest of the area.

Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
---
v3:
- Restore managed-page accounting for early-reserved pages regardless of
CMA_RESERVE_PAGES_ON_ERROR (reported by Sashiko)
---
mm/cma.c | 30 ++++++++++++++++++------------
mm/hugetlb.c | 8 +++-----
2 files changed, 21 insertions(+), 17 deletions(-)


Reviewed-by: Qi Zheng <qi.zheng@xxxxxxxxx>

Thanks,
Qi