Re: [GIT PULL] probes: Fixes for v6.12-rc4-2

From: Linus Torvalds
Date: Thu Oct 24 2024 - 17:05:39 EST


On Wed, 23 Oct 2024 at 07:36, Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
>
> - objpool: Fix choosing allocation for percpu slots
>
> Fixes to allocate objpool's percpu slots correctly according to the
> GFP flag. It checks whether "any bit" in GFP_ATOMIC is set to choose
> the vmalloc source, but it should check "all bits" in GFP_ATOMIC flag
> is set, because GFP_ATOMIC is a combined flag.

So the old code was buggy, but I don't think the new code is wonderful either.

For example, it does not recognized GFP_NOWAIT, which has very similar
characteristics to GFP_ATOMIC (it's basically the same thing as
GFP_ATOMIC, but without the "try to allocate urgently", and with an
added "don't warn on failure" as a result).

So what I think that code *should* test for is "can I sleep".

Which is indicated by __GFP_IO or __GFP_FS (and, I guess also
__GFP_DIRECT_RECLAIM).

Linus