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

Heiko Carstens
2025-09-17T07:27:42Z

On Tue, Sep 16, 2025 at 07:36:44PM +0200, Heiko Carstens 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):

Another correction: it should be GFP_KERNEL_ACCOUNT instead, like it
used to be before in gmap_alloc_crst() since those page tables should
be accounted to the process which is allocating them.