[PATCH v2 0/2] kho: add support for preserving vmalloc allocations

Mike Rapoport posted 2 patches 1 day, 8 hours ago
There is a newer version of this series
include/linux/kexec_handover.h |  12 ++
kernel/kexec_handover.c        | 200 +++++++++++++++++++++++++++++++++
lib/test_kho.c                 |  30 +++--
3 files changed, 235 insertions(+), 7 deletions(-)
[PATCH v2 0/2] kho: add support for preserving vmalloc allocations
Posted by Mike Rapoport 1 day, 8 hours ago
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Hi,

Following the discussion about preservation of memfd with LUO [1] these
patches add support for preserving vmalloc allocations.

Any KHO uses case presumes that there's a data structure that lists
physical addresses of preserved folios (and potentially some additional
metadata). Allowing vmalloc preservations with KHO allows scalable
preservation of such data structures.

For instance, instead of allocating array describing preserved folios in
the fdt, memfd preservation can use vmalloc:

        preserved_folios = vmalloc_array(nr_folios, sizeof(*preserved_folios));
        memfd_luo_preserve_folios(preserved_folios, folios, nr_folios);
        kho_preserve_vmalloc(preserved_folios, &folios_info);

[1] https://lore.kernel.org/all/20250807014442.3829950-30-pasha.tatashin@soleen.com

v2 changes:
* support preservation of vmalloc backed by large pages
* add check for supported vmalloc flags and preserve the flags to be
  able to identify incompatible preservations
* don't use kho_preserve_phys()
* add kernel-doc

v1: https://lore.kernel.org/all/20250903063018.3346652-1-rppt@kernel.org

Mike Rapoport (Microsoft) (2):
  kho: add support for preserving vmalloc allocations
  lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt

 include/linux/kexec_handover.h |  12 ++
 kernel/kexec_handover.c        | 200 +++++++++++++++++++++++++++++++++
 lib/test_kho.c                 |  30 +++--
 3 files changed, 235 insertions(+), 7 deletions(-)


base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
-- 
2.50.1
[PATCH v3 0/2] kho: add support for preserving vmalloc allocations
Posted by Mike Rapoport 1 day, 8 hours ago
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Hi,

Following the discussion about preservation of memfd with LUO [1] these
patches add support for preserving vmalloc allocations.

Any KHO uses case presumes that there's a data structure that lists
physical addresses of preserved folios (and potentially some additional
metadata). Allowing vmalloc preservations with KHO allows scalable
preservation of such data structures.

For instance, instead of allocating array describing preserved folios in
the fdt, memfd preservation can use vmalloc:

        preserved_folios = vmalloc_array(nr_folios, sizeof(*preserved_folios));
        memfd_luo_preserve_folios(preserved_folios, folios, nr_folios);
        kho_preserve_vmalloc(preserved_folios, &folios_info);

[1] https://lore.kernel.org/all/20250807014442.3829950-30-pasha.tatashin@soleen.com

v3 changes:
* rebase on mm-unstable

v2: https://lore.kernel.org/all/20250905131302.3595582-1-rppt@kernel.org
* support preservation of vmalloc backed by large pages
* add check for supported vmalloc flags and preserve the flags to be
  able to identify incompatible preservations
* don't use kho_preserve_phys()
* add kernel-doc

v1: https://lore.kernel.org/all/20250903063018.3346652-1-rppt@kernel.org

Mike Rapoport (Microsoft) (2):
  kho: add support for preserving vmalloc allocations
  lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt

 include/linux/kexec_handover.h |  12 ++
 kernel/kexec_handover.c        | 200 +++++++++++++++++++++++++++++++++
 lib/test_kho.c                 |  41 +++++--
 3 files changed, 241 insertions(+), 12 deletions(-)


base-commit: b024763926d2726978dff6588b81877d000159c1
-- 
2.50.1
Re: [PATCH v2 0/2] kho: add support for preserving vmalloc allocations
Posted by Mike Rapoport 5 hours ago
Argh, I've messed up the posting :(
Sorry for the noise.

On Sun, Sep 07, 2025 at 10:00:17AM +0300, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> 
> Hi,
> 
> Following the discussion about preservation of memfd with LUO [1] these
> patches add support for preserving vmalloc allocations.
> 
> Any KHO uses case presumes that there's a data structure that lists
> physical addresses of preserved folios (and potentially some additional
> metadata). Allowing vmalloc preservations with KHO allows scalable
> preservation of such data structures.
> 
> For instance, instead of allocating array describing preserved folios in
> the fdt, memfd preservation can use vmalloc:
> 
>         preserved_folios = vmalloc_array(nr_folios, sizeof(*preserved_folios));
>         memfd_luo_preserve_folios(preserved_folios, folios, nr_folios);
>         kho_preserve_vmalloc(preserved_folios, &folios_info);
> 
> [1] https://lore.kernel.org/all/20250807014442.3829950-30-pasha.tatashin@soleen.com
> 
> v2 changes:
> * support preservation of vmalloc backed by large pages
> * add check for supported vmalloc flags and preserve the flags to be
>   able to identify incompatible preservations
> * don't use kho_preserve_phys()
> * add kernel-doc
> 
> v1: https://lore.kernel.org/all/20250903063018.3346652-1-rppt@kernel.org
> 
> Mike Rapoport (Microsoft) (2):
>   kho: add support for preserving vmalloc allocations
>   lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt
> 
>  include/linux/kexec_handover.h |  12 ++
>  kernel/kexec_handover.c        | 200 +++++++++++++++++++++++++++++++++
>  lib/test_kho.c                 |  30 +++--
>  3 files changed, 235 insertions(+), 7 deletions(-)
> 
> 
> base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
> -- 
> 2.50.1
> 

-- 
Sincerely yours,
Mike.