[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mafs0ikh7dg54.fsf@kernel.org>
Date: Wed, 24 Sep 2025 17:28:07 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jason Gunthorpe <jgg@...dia.com>, Mike Rapoport <rppt@...nel.org>,
Alexander Graf <graf@...zon.com>, Baoquan He <bhe@...hat.com>,
Changyuan Lyu <changyuanl@...gle.com>, Chris Li <chrisl@...nel.org>,
Pasha Tatashin <pasha.tatashin@...een.com>, Pratyush Yadav
<pratyush@...nel.org>, kexec@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 3/4] kho: add support for preserving vmalloc allocations
On Mon, Sep 22 2025, Andrew Morton wrote:
> On Mon, 22 Sep 2025 10:19:48 -0300 Jason Gunthorpe <jgg@...dia.com> wrote:
>
>> > +static void kho_vmalloc_free_chunks(struct kho_vmalloc *kho_vmalloc)
>> > +{
>> > + struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(kho_vmalloc->first);
>> > +
>> > + while (chunk) {
>> > + struct kho_vmalloc_chunk *tmp = chunk;
>> > +
>> > + kho_vmalloc_unpreserve_chunk(chunk);
>> > +
>> > + chunk = KHOSER_LOAD_PTR(chunk->hdr.next);
>> > + kfree(tmp);
>>
>> Shouldn't this be free_page()?
>
> Or vfree()?
It should be free_page(). The chunk isn't in the vmalloc-ed area, it is
the metadata to track it. It gets allocated in new_vmalloc_chunk() using
get_zeroed_page().
>
> Not sure why this code works - I'll suspend the series from linux-next
> for now.
It only gets called in the error path and that didn't get hit during
testing I suppose. Until v3 the chunk was being allocated using
kzalloc() so I guess this got missed in the move to get_zeroed_page().
I think Mike is out of office this week. Do you think this series is
stable enough to land in the upcoming merge window? If so, I can send a
v6 with the fix today.
--
Regards,
Pratyush Yadav
Powered by blists - more mailing lists