Re: [PATCH 0/4] KVM: s390: replace page allocator calls with kzalloc()
From: Mike Rapoport
Date: Thu Sep 03 2026 - 04:56:41 EST
Hi Claudio,
On Wed, Sep 02, 2026 at 04:53:15PM +0200, Claudio Imbrenda wrote:
> On Wed, 2 Sep 2026 16:17:03 +0300
> Mike Rapoport <rppt@xxxxxxxxxx> wrote:
>
> > On Wed, Sep 02, 2026 at 01:06:12PM +0200, Claudio Imbrenda wrote:
> > > On Wed, 02 Sep 2026 09:15:12 +0300
> > > "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx> wrote:
> > >
> > > > This is a (small) part of larger work of replacing page allocator calls
> > > > with kmalloc.
> > >
> > > I have some objections to this series, but not because of what you are
> > > trying to do (which is actually nice).
> > >
> > > I understand that you probably wanted to touch as little code as
> > > possible,
> >
> > Yep :)
> >
> > > but now since you're rewriting the allocations to use
> > > kmalloc.... I'd like them to be converted to use the __free(kvmalloc)
> >
> > You mean __free(kfree)? Sure, I can look into it.
>
> yep :)
Well, I looked :)
The only place where __free(kfree) is completely safe is handle_sthyi().
In all the other functions using __free(kfree) creates a mix of of goto
and cleanup helpers and cleanup docs advise against mixing them:
https://docs.kernel.org/core-api/cleanup.html
The cleanup paths are quite involved in these functions so using
__free(kfree) there is really not trivial.
--
Sincerely yours,
Mike.