Re: [PATCH bpf-next v3 1/6] mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation

Shakeel Butt
2024-12-19T00:10:36Z

On Tue, Dec 17, 2024 at 07:07:14PM -0800, alexei.starovoitov@gmail.com wrote:
> From: Alexei Starovoitov <ast@kernel.org>
>
[...]
> +
> +struct page *try_alloc_pages_noprof(int nid, unsigned int order)
> +{
> + gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO |
> + __GFP_NOMEMALLOC | __GFP_TRYLOCK;

I think the above needs a comment to be more clear. Basically why zero,
nomemalloc and no warn? Otherwise this looks good. I don't have a strong
opinion on __GFP_TRYLOCK and maybe just ALLOC_TRYLOCK would be good
enough.