[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250409183223.GO1778492@nvidia.com>
Date: Wed, 9 Apr 2025 15:32:23 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Mike Rapoport <rppt@...nel.org>
Cc: Pratyush Yadav <ptyadav@...zon.de>,
Changyuan Lyu <changyuanl@...gle.com>, linux-kernel@...r.kernel.org,
graf@...zon.com, akpm@...ux-foundation.org, luto@...nel.org,
anthony.yznaga@...cle.com, arnd@...db.de, ashish.kalra@....com,
benh@...nel.crashing.org, bp@...en8.de, catalin.marinas@....com,
dave.hansen@...ux.intel.com, dwmw2@...radead.org,
ebiederm@...ssion.com, mingo@...hat.com, jgowans@...zon.com,
corbet@....net, krzk@...nel.org, mark.rutland@....com,
pbonzini@...hat.com, pasha.tatashin@...een.com, hpa@...or.com,
peterz@...radead.org, robh+dt@...nel.org, robh@...nel.org,
saravanak@...gle.com, skinsburskii@...ux.microsoft.com,
rostedt@...dmis.org, tglx@...utronix.de, thomas.lendacky@....com,
usama.arif@...edance.com, will@...nel.org,
devicetree@...r.kernel.org, kexec@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org
Subject: Re: [PATCH v5 09/16] kexec: enable KHO support for memory
preservation
On Wed, Apr 09, 2025 at 07:28:47PM +0300, Mike Rapoport wrote:
> On Mon, Apr 07, 2025 at 11:16:26AM -0300, Jason Gunthorpe wrote:
> > On Sun, Apr 06, 2025 at 07:11:14PM +0300, Mike Rapoport wrote:
> >
> > KHO needs to provide a way to give back an allocated struct page/folio
> > that can be freed back to the buddy alloactor, of the proper
> > order. Whatever you call that function it belongs to KHO as it is
> > KHO's primary responsibility to manage the buddy allocator and the
> > struct pages.
>
> If order is only important for freeing memory back to page allocator, you
> don't really need it. Freeing contiguous power-of-two number of pages with
> proper alignment will give the same result, just a tad slower.
What I'm asking for is transparency for the driver.
iommu going to be doing:
folio = __folio_alloc_node(order >= 0)
[.. init struct ioptdesc that is overlayed with struct folio ]
folio_put(folio);
As that is how you make memdescs work today. So when we add KHO, I
want to see:
folio = __folio_alloc_node(order >= 0);
[.. init struct ioptdesc that is overlayed with struct folio ]
kho_preserve_folio(folio);
// kexec
folio = kho_restore_folio(phys);
[.. init struct ioptdesc that is overlayed with struct folio ]
folio_put(folio);
Working fully.
I do not want to mess with the existing folio_put() code just because
KHO can't preserve __folio_alloc_node().
Tomorrow someday I think we will switch to a flow more like
memory = memdesc_alloc(&ioptdesc, order >= 0);
[.. init struct ioptdesc that is a new allocation]
kho_preserve_memdesc(ioptdesc)
// kexec
memory = kho_restore_memdesc(phys, &ioptdesc)
[.. init struct ioptdesc that is a new allocation]
memdesc_free(memory, ioptdesc);
Jason
Powered by blists - more mailing lists