Re: [PATCH v3] mm/cma: move put_page_testzero() out of VM_WARN_ON in cma_release()
From: SeongJae Park
Date: Wed Feb 25 2026 - 20:02:16 EST
On Tue, 24 Feb 2026 22:12:31 -0500 Zi Yan <ziy@xxxxxxxxxx> wrote:
> When CONFIG_DEBUG_VM is not set, VM_WARN_ON is a NOP. Putting any statement
> with side effect inside it is incorrect. Collect all !put_page_testzero()
> results and check the sum using WARN instead after the loop. It restores
> the same check in free_contig_range() before commit
> e0c1326779cc ("mm: page_alloc: add alloc_contig_frozen_{range,pages}()"),
> the commit prior to the Fixes one.
>
> Fixes: 9bda131c6093 ("mm: cma: add cma_alloc_frozen{_compound}()")
> Reported-by: Ron Economos <re@xxxxxxxx>
> Closes: https://lore.kernel.org/all/1b17c38f-30d3-4bb4-a7e1-e74b19ada885@xxxxxxxx/
> Suggested-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
Thanks,
SJ
[...]