Skip to content

Make KHO Stateless

Jason Miu kexec linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Changes in v3 from the cover letter

- The preserved memory tracking data structures is defined in the ABI header.
- Relocate the kho_vmalloc struct and its helper macro to the KHO ABI header to formalize its status as a stable ABI.
- Export the core radix tree manipulation functions as a public API to support broader use by other kernel subsystems.
- Update the documents.
- Inline comments have been cleaned up.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kho: Introduce KHO FDT ABI headerDocumentation/core-api/kho/bindings/kho.yaml Documentation/core-api/kho/bindings/sub-fdt.yaml Documentation/core-api/kho/concepts.rst +3 more+116 -1490 replies
2/4kho: Relocate vmalloc preservation structure to KHO ABI headerDocumentation/core-api/kho/fdt.rst include/linux/kexec_handover.h include/linux/kho/abi/kexec_handover.h +3 more+88 -410 replies
3/4kho: Adopt radix tree for preserved memory trackingDocumentation/core-api/kho/concepts.rst Documentation/core-api/kho/fdt.rst Documentation/core-api/kho/index.rst +4 more+568 -3220 replies
4/4kho: Remove finalize state and clientsDocumentation/admin-guide/mm/kho.rst Documentation/core-api/kho/concepts.rst kernel/liveupdate/kexec_handover.c +5 more+10 -1160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Make KHO Stateless

This series transitions KHO from an xarray-based metadata tracking system with serialization to using a radix tree data structure that can be passed directly to the next kernel.

The key motivations for this change are to:
- Eliminate the need for data serialization before kexec.
- Remove the KHO finalize state.
- Pass preservation metadata more directly to the next kernel via the FDT.

The new approach uses a radix tree to mark preserved pages. A page's physical address and its order are encoded into a single value. The tree is composed of multiple levels of page-sized tables, with leaf nodes being bitmap tables where each set bit represents a preserved page. The physical address of the radix trees root is passed in the FDT, allowing the next kernel to reconstruct the preserved memory map.

This series is broken down into the following patches:

1. kho: Introduce KHO FDT ABI header:
Adds a dedicated ABI header to define the FDT interface.

2. kho: Relocate vmalloc preservation structure to KHO ABI header Adds struct kho_vmalloc and related structs to the ABI header.

3. kho: Adopt radix tree for preserved memory tracking:
Replaces the xarray-based tracker with the new radix tree implementation and increments the ABI version.

4. kho: Remove finalize state and clients:
Removes the now-obsolete kho_finalize() function and its usage from client code and debugfs.

---

Changes in v3:
- The preserved memory tracking data structures is defined in the ABI header.
- Relocate the kho_vmalloc struct and its helper macro to the KHO ABI header to formalize its status as a stable ABI.
- Export the core radix tree manipulation functions as a public API to support broader use by other kernel subsystems.
- Update the documents.
- Inline comments have been cleaned up.

---

Jason Miu (4):
kho: Introduce KHO FDT ABI header
kho: Relocate vmalloc preservation structure to KHO ABI header
kho: Adopt radix tree for preserved memory tracking
kho: Remove finalize state and clients

 Documentation/admin-guide/mm/kho.rst          |  46 +-
 Documentation/core-api/kho/bindings/kho.yaml  |  43 --
 .../core-api/kho/bindings/sub-fdt.yaml        |  27 -
 Documentation/core-api/kho/concepts.rst       |  28 +-
 Documentation/core-api/kho/fdt.rst            |  84 +--
 Documentation/core-api/kho/index.rst          |   1 +
 Documentation/core-api/kho/radix_tree.rst     |  17 +
 include/linux/kexec_handover.h                |  27 +-
 include/linux/kho/abi/kexec_handover.h        | 268 +++++++
 include/linux/kho/abi/memfd.h                 |   2 +-
 include/linux/kho_radix_tree.h                |  81 ++
 kernel/liveupdate/kexec_handover.c            | 694 +++++++++---------
 kernel/liveupdate/kexec_handover_debugfs.c    |  20 -
 kernel/liveupdate/kexec_handover_internal.h   |   3 -
 kernel/liveupdate/luo_core.c                  |  12 +-
 kernel/liveupdate/luo_flb.c                   |   2 +-
 lib/test_kho.c                                |   1 +
 tools/testing/selftests/kho/init.c            |  20 -
 18 files changed, 765 insertions(+), 611 deletions(-)
 delete mode 100644 Documentation/core-api/kho/bindings/kho.yaml
 delete mode 100644 Documentation/core-api/kho/bindings/sub-fdt.yaml
 create mode 100644 Documentation/core-api/kho/radix_tree.rst
 create mode 100644 include/linux/kho/abi/kexec_handover.h
 create mode 100644 include/linux/kho_radix_tree.h

base-commit: 7d31f578f3230f3b7b33b0930b08f9afd8429817

Signature · 1 line
2.52.0.223.gf5cc29aaa4-goog