]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: rename try_alloc_pages() to alloc_pages_nolock()
authorAlexei Starovoitov <ast@kernel.org>
Sat, 17 May 2025 00:34:46 +0000 (17:34 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 May 2025 21:55:37 +0000 (14:55 -0700)
commit2aad4edf6e1018b28b7000faec56b7b6e585c8e1
tree1e3552563bc56fc061b6d53db3192cbe2a08bba3
parent5fc4b770fc35c05874dd2dd5bf1f03d354025b62
mm: rename try_alloc_pages() to alloc_pages_nolock()

The "try_" prefix is confusing, since it made people believe that
try_alloc_pages() is analogous to spin_trylock() and NULL return means
EAGAIN.  This is not the case.  If it returns NULL there is no reason to
call it again.  It will most likely return NULL again.  Hence rename it to
alloc_pages_nolock() to make it symmetrical to free_pages_nolock() and
document that NULL means ENOMEM.

Link: https://lkml.kernel.org/r/20250517003446.60260-1-alexei.starovoitov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Harry Yoo <harry.yoo@oracle.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/gfp.h
kernel/bpf/syscall.c
mm/page_alloc.c
mm/page_owner.c