Re: [PATCH v5 01/18] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK
From: Zi Yan
Date: Fri Jul 03 2026 - 10:23:17 EST
On Fri Jul 3, 2026 at 8:31 AM EDT, Brendan Jackman wrote:
> It's confusing that the function is called "nolock" but the flag is
> called "trylock", align them.
>
> The function's terminology is more visible and has more mindshare so use that.
>
> Suggested-by: "Vlastimil Babka (SUSE)" <vbabka@xxxxxxxxxx>
> Link: https://lore.kernel.org/linux-mm/2399b3ad-4eac-4a14-94c3-27e9f07972a1@xxxxxxxxxx/
> Reviewed-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> Reviewed-by: Harry Yoo (Oracle) <harry@xxxxxxxxxx>
> Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
> ---
> mm/internal.h | 2 +-
> mm/page_alloc.c | 10 +++++-----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index fa4fb69444ecd..a2b09a13735bf 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1480,7 +1480,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
> #define ALLOC_NOFRAGMENT 0x0
> #endif
> #define ALLOC_HIGHATOMIC 0x200 /* Allows access to MIGRATE_HIGHATOMIC */
> -#define ALLOC_TRYLOCK 0x400 /* Only use spin_trylock in allocation path */
> +#define ALLOC_NOLOCK 0x400 /* Only use spin_trylock in allocation path */
It is strange to me that _NOLOCK uses spin_trylock. Lock or no lock? :)
But it matches the _nolock function. Anyway,
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
--
Best Regards,
Yan, Zi