[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+CK2bA2L546L5qSoicA=R2S+a0R+D_kp_uo050uBD3B8f4MGw@mail.gmail.com>
Date: Tue, 13 Jan 2026 11:16:27 -0500
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Mike Rapoport <rppt@...nel.org>, Jason Miu <jasonmiu@...gle.com>,
Alexander Graf <graf@...zon.com>, Andrew Morton <akpm@...ux-foundation.org>, Baoquan He <bhe@...hat.com>,
Changyuan Lyu <changyuanl@...gle.com>, David Matlack <dmatlack@...gle.com>,
David Rientjes <rientjes@...gle.com>, Pratyush Yadav <pratyush@...nel.org>, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v4 1/2] kho: Adopt radix tree for preserved memory tracking
On Tue, Jan 13, 2026 at 9:58 AM Jason Gunthorpe <jgg@...dia.com> wrote:
>
> On Tue, Jan 13, 2026 at 04:46:01PM +0200, Mike Rapoport wrote:
> > On Tue, Jan 13, 2026 at 09:05:26AM -0400, Jason Gunthorpe wrote:
> > > On Tue, Jan 13, 2026 at 01:34:42PM +0200, Mike Rapoport wrote:
> > >
> > > > For example mshv intends to use kho_radix_tree to track the hypervisor
> > > > memory and there unpreserving will be a part of the normal flow.
> > >
> > > I do not think this is a good idea.
> >
> > Sorry I wasn't clear, mshv is not going to use KHO memory tracker but
> > another instance of kho_radix_tree data structure.
> > I don't see a problem with that.
>
> Oh.. That's.. Interesting but sure if it is made into a library then
> it makes some sense that it would need freeing support somehow.
>
> I'm surprised there isn't a better data structure for what mshv needs
> though?
It seems both MSHV and kho_radix_tree have an ABI requirement for data
to be parsable by the next kernel. Even if other libraries might work
better, they likely won't need to meet the stability and versioning
requirements for cross-kernel interfaces.
>
> > > Nothing should be touching KHO until a kexec sequence is started. KHO
> > > calls should WARN_ON prior to this point. If a kexec sequence aborts
> > > then the entire radix tree should be discarded and it should go back
> > > to WARN_ON'ing KHO calls.
> >
> > The whole point of making KHO stateless was to decouple it from kexec
> > sequence and let userspace control when preservation happens and to allow
> > preserving as much as possible ahead of time to save cycles at
> > kexec-reboot.
>
> Sure, but also the data structures should not have a life of their
> own, it needs to start from an empty slate every time luo starts the
> sequence. There cannot be cruft left over from previous failed
> attempts or something
Even if a kexec fails, as long as someone still holds LUO session
references, we might successfully kexec the next time. KHO
unpreserving will only occur once the LUO session FDs are closed.
Pasha
Powered by blists - more mailing lists