Re: [PATCH v3 03/18] mm/huge_memory: invert folio_ref_freeze() check to reduce indentation
From: Kiryl Shutsemau
Date: Thu Aug 27 2026 - 10:43:41 EST
On Fri, Aug 21, 2026 at 02:55:16AM +0800, Kairui Song via B4 Relay wrote:
> From: Kairui Song <kasong@xxxxxxxxxxx>
>
> Invert the folio_ref_freeze() success check in
> __folio_freeze_and_split_unmapped() to return early on failure, which
> removes one level of indentation from the entire success path.
>
> This is a pure refactoring with no functional change. It prepares the
> function to be split into separate helpers for anonymous and
> file-backed folios in a later patch.
>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
Zi already pointed out that it interacts with my change:
https://lore.kernel.org/all/20260826162101.1314941-3-kirill@xxxxxxxxxxxxx
--
Kiryl Shutsemau / Kirill A. Shutemov