From: Jason Miu <jasonmiu@google.com>
To: Alexander Graf <graf@amazon.com>,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <bhe@redhat.com>,
Changyuan Lyu <changyuanl@google.com>,
David Matlack <dmatlack@google.com>,
David Rientjes <rientjes@google.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Jason Miu <jasonmiu@google.com>, Mike Rapoport <rppt@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH v4 0/2] Make KHO Stateless
Date: Thu, 8 Jan 2026 16:11:25 -0800 [thread overview]
Message-ID: <20260109001127.2596222-1-jasonmiu@google.com> (raw)
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 v3 [1]:
- The patches introducing the KHO FDT ABI header [2] and relocating the
vmalloc preservation structure to the KHO ABI header [3] were merged
into another series [4].
- Use `struct kho_radix_tree` to encapsulate the tree structure and
expose it to the public radix tree APIs as an argument.
- Public radix tree APIs now manage the tree structure's lock internally.
- Protect the radix tree with a mutex lock instead of a read-write
semaphore.
- Radix tree root pointer validation and warnings are now centralized in
kho_radix_add_page() and kho_radix_del_page().
- Updates to the KHO finalization logic are grouped into the second patch.
- kho_radix_encode_key() and kho_radix_decode_key() were removed from
the public APIs.
- KHO radix tree callback function takes physical address and order of a page as
inputs instead of a radix key.
- Refactored kho_radix_get_index() to use kho_radix_get_bitmap_index().
- Updated the documentation.
[1] https://lore.kernel.org/lkml/20251209025317.3846938-1-jasonmiu@google.com/
[2] https://lore.kernel.org/lkml/20251209025317.3846938-2-jasonmiu@google.com/
[3] https://lore.kernel.org/lkml/20251209025317.3846938-3-jasonmiu@google.com/
[4] https://lore.kernel.org/lkml/20260105165839.285270-1-rppt@kernel.org/
---
Jason Miu (2):
kho: Adopt radix tree for preserved memory tracking
kho: Remove finalize state and clients
Documentation/admin-guide/mm/kho.rst | 52 +-
Documentation/core-api/kho/abi.rst | 6 +
Documentation/core-api/kho/index.rst | 23 +-
include/linux/kho/abi/kexec_handover.h | 141 +++-
include/linux/kho_radix_tree.h | 72 ++
kernel/liveupdate/kexec_handover.c | 703 ++++++++++----------
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, 573 insertions(+), 484 deletions(-)
create mode 100644 include/linux/kho_radix_tree.h
base-commit: f96074c6d01d8a5e9e2fccd0bba5f2ed654c1f2d
--
2.52.0.457.g6b5491de43-goog
next reply other threads:[~2026-01-09 0:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 0:11 Jason Miu [this message]
2026-01-09 0:11 ` [PATCH v4 1/2] kho: Adopt radix tree for preserved memory tracking Jason Miu
2026-01-09 0:11 ` [PATCH v4 2/2] kho: Remove finalize state and clients Jason Miu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260109001127.2596222-1-jasonmiu@google.com \
--to=jasonmiu@google.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=changyuanl@google.com \
--cc=dmatlack@google.com \
--cc=graf@amazon.com \
--cc=jgg@nvidia.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox