Re: [PATCH v2 08/20] KVM: s390: KVM page table management functions: allocation

Heiko Carstens
2025-09-16T17:36:54Z

On Tue, Sep 16, 2025 at 07:06:06PM +0200, Christian Borntraeger wrote:
>
> Am 16.09.25 um 19:05 schrieb Claudio Imbrenda:
>
> > > > I think GFP_ATOMIC actually gives more guarantees?
> > >
> > > In real life GFP_ATOMIC can fail, GFP_KERNEL does not.All gfp allocation failures
> > > are usually the atomic ones.
> >
> > interesting... then I guess I need GFP_KERNEL | GFP_ATOMIC ?
>
> No. ATOMIC always means: can fail.

So GFP_KERNEL alone is what is needed here. It is undocumented that
small GFP_KERNEL allocations will never fail (retried for ever):

https://lwn.net/Articles/627419/
https://lwn.net/Articles/723317/

While GFP_ATOMIC will fail e.g. if I/O is required to free up some
memory.