linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Make KHO Stateless
@ 2026-01-13  5:35 Jason Miu
  2026-01-13  5:35 ` [PATCH v5 1/2] kho: Adopt radix tree for preserved memory tracking Jason Miu
  2026-01-13  5:35 ` [PATCH v5 2/2] kho: Remove finalize state and clients Jason Miu
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Miu @ 2026-01-13  5:35 UTC (permalink / raw)
  To: Alexander Graf, Andrew Morton, Baoquan He, Changyuan Lyu,
	David Matlack, David Rientjes, Jason Gunthorpe, Jason Miu,
	Mike Rapoport, Pasha Tatashin, Pratyush Yadav, kexec,
	linux-kernel, linux-mm

This series transitions KHO from an xarray-based metadata tracking system
with serialization to 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 bitmaps where each set bit represents a preserved page. The
physical address of the radix tree's 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: Adopt radix tree for preserved memory tracking:    
    Replaces the xarray-based tracker with the new radix tree
    implementation and increments the ABI version.

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

---

Changelog since v4 [1]:
- Removed the 'level' and 'start' arguments from the KHO radix tree API
  kho_radix_walk_tree().
- Removed locking of the KHO radix tree root during module initialization,
  as it is the sole user of the tree at that stage.
- Renamed kho_radix_get_index() to kho_radix_get_table_index() and updated
  callers to invoke kho_radix_get_bitmap_index() explicitly for the bitmap
  (leaf) level.
- Updated documentation to clarify that "page offset" is now referred to as
  "shifted physical address".

[1] https://lore.kernel.org/lkml/20260109001127.2596222-1-jasonmiu@google.com/

---

Jason Miu (2):
  kho: Adopt radix tree for preserved memory tracking
  kho: Remove finalize state and clients

 Documentation/admin-guide/mm/kho.rst        |  53 +-
 Documentation/core-api/kho/abi.rst          |   6 +
 Documentation/core-api/kho/index.rst        |  18 +-
 include/linux/kho/abi/kexec_handover.h      | 141 +++-
 include/linux/kho_radix_tree.h              |  70 ++
 kernel/liveupdate/kexec_handover.c          | 682 ++++++++++----------
 kernel/liveupdate/kexec_handover_debugfs.c  |  23 -
 kernel/liveupdate/kexec_handover_internal.h |   3 -
 kernel/liveupdate/luo_core.c                |  12 +-
 kernel/liveupdate/luo_flb.c                 |   2 +-
 tools/testing/selftests/kho/init.c          |  20 -
 11 files changed, 557 insertions(+), 473 deletions(-)
 create mode 100644 include/linux/kho_radix_tree.h


base-commit: f417b7ffcbef7d76b0d8860518f50dae0e7e5eda
-- 
2.52.0.457.g6b5491de43-goog


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

end of thread, other threads:[~2026-01-13  5:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13  5:35 [PATCH v5 0/2] Make KHO Stateless Jason Miu
2026-01-13  5:35 ` [PATCH v5 1/2] kho: Adopt radix tree for preserved memory tracking Jason Miu
2026-01-13  5:35 ` [PATCH v5 2/2] kho: Remove finalize state and clients Jason Miu

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