Re: [PATCH] s390/uv: Rework page allocation for guest variable storage area

From: Alexander Gordeev

Date: Fri Sep 18 2026 - 07:59:41 EST


On Thu, Sep 17, 2026 at 09:35:40PM +0200, Heiko Carstens wrote:
> On Thu, Sep 17, 2026 at 12:26:55PM +0200, Alexander Gordeev wrote:
> > On Tue, Sep 15, 2026 at 04:43:07PM +0200, Heiko Carstens wrote:
> > Hi Heiko,
> > ...
> > > + for (i = 0; i < nr_pages; i++) {
> > > + pages[i] = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
> > > + if (!pages[i])
> > > + goto free_pages;
> > > + }
> > ...
> > > + for (i = 0; i < nr_pages; i++) {
> > > + if (pages[i])
> > > + __free_page(pages[i]);
> > > + }
> >
> > Why not alloc_pages_bulk()/free_pages_bulk()?
>
> That's because alloc_pages_bulk() contains this:
>
> /* Bulk allocator does not support memcg accounting. */
> if (memcg_kmem_online() && (gfp & __GFP_ACCOUNT))
> goto failed;
>
> Which does not work with GFP_KERNEL_ACCOUNT.

Thanks for the clarification!

Acked-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>