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

Claudio Imbrenda
2025-09-17T12:12:18Z

On Tue, 16 Sep 2025 19:36:44 +0200
Heiko Carstens <hca@linux.ibm.com> wrote:

> 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.

ah, "how small is small" is answered in those links, ignore my question