Re: [LSF/MM/BPF TOPIC] memory persistence over kexec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jason,

On Mon, Jan 20, 2025 at 10:14:27AM -0400, Jason Gunthorpe wrote:
> On Mon, Jan 20, 2025 at 09:54:15AM +0200, Mike Rapoport wrote:
> > Hi,
> > 
> > I'd like to discuss memory persistence across kexec.
> > 
> > Currently there is ongoing work on Kexec HandOver (KHO) [1] that allows
> > serialization and deserialization of kernel data as well as preserving
> > arbitrary memory ranges across kexec.
> > 
> > In addition, KHO keeps a physically contiguous memory regions that are
> > guaranteed to not have any memory that KHO would preserve, but still can be
> > used by the system. The kexeced kernel bootstraps itself using those
> > regions and sets all handed over memory as in use. KHO users then can
> > recover their state from the preserved data. This includes memory
> > reservations, where the user can either discard or claim reservations.
> > 
> > KHO can be used as the base layer for implementation of persistence-aware
> > memory allocator and persistent in-memory filesystem.
> > 
> > Aside from status update on KHO progress there are a few topics that I would
> > like to discuss:
> > * Is it feasible and desirable to enable KHO support in tmpfs and hugetlbfs?
> > * Or is it better to implement yet another in-memory filesystem dedicated
> >   for persistence?
> > * What is the best way to ensure that the memory we want to persist is not
> >   scattered all over the place?
> 
> There is alot of talk about taking *drivers* and having them survive
> kexec, meaning the driver has to put alot of its state into KHO and
> then get it back out again.
> 
> I've been hoping for a model where a driver can be told to "go to KHO"
> and the KHO code can be largely contained in the driver and regulated
> to recording the driver state. This implies the state may be
> fragmented all over memory.

I'm not sure I follow what do you mean by "go to KHO" here.

I believe that ftrace example in Alex's v3 of KHO
(https://lore.kernel.org/all/20240117144704.602-1-graf@xxxxxxxxxx)
has enough meat to demonstrate the basic model.

The driver has to pass the state it wishes to preserve and then during the
initialization after kexec the driver can restore it's state from the
preserved one.
 
> The other direction is that the driver has to start up in some special
> KHO mode and KHO becomes invasive on all driver paths to use special
> KHO allocations. This seems like a PITA.
> 
> You can see this difference just in the discussion around the iommu
> serialization where one idea was to have KHO be an integral (and
> invasive!) part of the page table operations from time zero vs some
> later serialization at kexec time.

I didn't follow that discussion closely, but there still should be a step
when iommu driver would try to deserialize the data and use it if
deserialization succeeds.

My understanding it that a major part of the complexity in iommu is the
userspace facing bits that need to be somehow connected to the restored in
kernel structures after kexec.

> Regardless, I'm interested in this discussion to bring some
> concreteness about how drivers work..
> 
> Jason

-- 
Sincerely yours,
Mike.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux