linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] kho: add support for preserving vmalloc allocations
@ 2025-09-21  5:44 Mike Rapoport
  2025-09-21  5:44 ` [PATCH v5 1/4] kho: check if kho is finalized in __kho_preserve_order() Mike Rapoport
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Mike Rapoport @ 2025-09-21  5:44 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Alexander Graf, Baoquan He, Changyuan Lyu, Chris Li,
	Jason Gunthorpe, Mike Rapoport, Pasha Tatashin, Pratyush Yadav,
	kexec, linux-mm, linux-kernel

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

v5 changes:
* rebase on mm-new of September 17
* use kho_restore_pages() in kho_restore_vmalloc(). Required to resolve
  a conflict with "kho: make sure page being restored is actually from KHO"
* use more descriptive local variable names in kho_restore_vmalloc()

v4: https://lore.kernel.org/all/20250917174033.3810435-1-rppt@kernel.org 
* rebase on mm-stable
* use 'struct kho_vmalloc' as preservation metadata instead of storing it in the first chunk
* separate KHO flags from VM_ flags
* unreserve vmalloc pages on error
* add checks for under- and overflow of preserved metadata

v3: https://lore.kernel.org/all/20250908103528.2179934-1-rppt@kernel.org
* 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) (4):
  kho: check if kho is finalized in __kho_preserve_order()
  kho: replace kho_preserve_phys() with kho_preserve_pages()
  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 |  33 ++-
 kernel/kexec_handover.c        | 361 +++++++++++++++++++++++++++++----
 lib/test_kho.c                 |  41 ++--
 mm/memblock.c                  |   4 +-
 4 files changed, 381 insertions(+), 58 deletions(-)


base-commit: c565f9816932dc8d164bd8c69acf077840565ce7
-- 
2.50.1



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-09-25 11:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-21  5:44 [PATCH v5 0/4] kho: add support for preserving vmalloc allocations Mike Rapoport
2025-09-21  5:44 ` [PATCH v5 1/4] kho: check if kho is finalized in __kho_preserve_order() Mike Rapoport
2025-09-21  5:44 ` [PATCH v5 2/4] kho: replace kho_preserve_phys() with kho_preserve_pages() Mike Rapoport
2025-09-22 13:14   ` Jason Gunthorpe
2025-09-22 13:50   ` Pratyush Yadav
2025-09-21  5:44 ` [PATCH v5 3/4] kho: add support for preserving vmalloc allocations Mike Rapoport
2025-09-22 13:19   ` Jason Gunthorpe
2025-09-22 21:34     ` Andrew Morton
2025-09-24 15:28       ` Pratyush Yadav
2025-09-24 21:00         ` Andrew Morton
2025-09-25 11:22           ` Pratyush Yadav
2025-09-22 13:50   ` Pratyush Yadav
2025-09-22 14:17   ` Pasha Tatashin
2025-09-22 21:23     ` Andrew Morton
2025-09-22 22:31   ` yanjun.zhu
2025-09-22 23:08     ` Andrew Morton
2025-09-23  5:04       ` Zhu Yanjun
2025-09-21  5:44 ` [PATCH v5 4/4] lib/test_kho: use kho_preserve_vmalloc instead of storing addresses in fdt Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox