Re: [PATCH v2 5/9] mm/huge_memory: add a common exit path to zap_huge_pmd()

Baolin Wang
2026-03-20T03:27:38Z

On 3/19/26 9:00 PM, Lorenzo Stoakes (Oracle) wrote:
> Other than when we acquire the PTL, we always need to unlock the PTL, and
> optionally need to flush on exit.
>
> The code is currently very duplicated in this respect, so default
> flush_needed to false, set it true in the case in which it's required, then
> share the same logic for all exit paths.
>
> This also makes flush_needed make more sense as a function-scope value (we
> don't need to flush for the PFN map/mixed map, zero huge, error cases for
> instance).
>
> Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
> ---

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>