Re: [PATCH] mm/page_alloc: Fix try_alloc_pages

Michal Hocko
2025-04-01T08:42:15Z

On Mon 31-03-25 20:23:36, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
>
> Fix an obvious bug. try_alloc_pages() should set_page_refcounted.
>
> Fixes: 97769a53f117 ("mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation")
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>
> As soon as I fast forwarded and rerun the tests the bug was
> seen immediately.
> I'm completely baffled how I managed to lose this hunk.
> I'm pretty sure I manually tested various code paths of
> trylock logic with CONFIG_DEBUG_VM=y.
> Pure incompetence :(

I believe Vlastimil is right. This seems to be an unfortunate mismatch
in the final tree when this got merged.
--
Michal Hocko
SUSE Labs