Re: [PATCH v2 5/9] mm/huge_memory: add a common exit path to zap_huge_pmd()
From: Baolin Wang
Date: Thu Mar 19 2026 - 23:27:41 EST
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@xxxxxxxxxx>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>