From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 641DA18DB2A for ; Thu, 15 Jan 2026 23:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768518052; cv=none; b=BX/eFQO5wus2FSqdPgHYbkTFyF8SxI1ZohwfiwMzW1TgI79HItA8qfQ+eTZCuYqg/Rm51kcDPvEBE+N1dUx56aZRGilOWRO3gWPvw5uV5tDn6rl1Dqqb//UYqPL+6dgBiDpQQQnq4mQ9uk3Y8K9ujYfEDr3jYNYaKzbvTtIJr/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768518052; c=relaxed/simple; bh=4BcBNsGiQgquxKi1nnrDAfh0h7socSXAW9R5XvaYArc=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=QV9sC81i6rtEPgZqxYGID/FC0QAaXndtRPU/+0vzXHzwEGth4syZyUPoDXo1z2NG/1BV+X+cK/i4xNPUpQw5/p7Ea4FzHuKcVFq70eelomYOVuW5uHoyHmJSfVVCljthKOQAWL77wgbmrYDcd2n6QObenJuMGCX+4lrq1djbRpU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jasonmiu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jOY4/20d; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jasonmiu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jOY4/20d" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-12339eea50bso7627046c88.1 for ; Thu, 15 Jan 2026 15:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768518050; x=1769122850; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=dgz1DtuTuOXgXInLnCBHEUta7LHhfgJVWxb17yQm2vY=; b=jOY4/20dQtxGR+e3hMlocYhjaf+uENeUaFTennLzBfSTmoSKAtfMK9oTeJHDnMfhFI k2WDa4sO9WvFhYA6rO+s9zGxls6rZ70iQuNnPR6VwDnYn6iju19H9NqJaHNykK3bA0gB 7Gw6aKqbUvIqD/A56Q6elEgUrgr+0KG7KjUxuiRD15Nw3mVI0OMLULeCGsNagnwrWw3l rRqo+B+dbjAzdE6g0sBTUI00lQghz9hQ6k1wqR3e13KiiEcfu2vAxUiWCob5MBUaeUeH x1TIcRE6J/udCrScYV5arKwTz89EEAGuzbPU7/KuTs2I9uS8CSeX3DWIa9wxeMCN+fNu qn1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768518050; x=1769122850; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dgz1DtuTuOXgXInLnCBHEUta7LHhfgJVWxb17yQm2vY=; b=Ijb4TJy1WTxFxkO6uiiQwuFg6GYXL9IlshtwFRAcnvqKbYSBSWE0mFUGjGWY8TfPAc aAPhUH7yan78iywHfeosOGrm60VWBKAnAdh20ozjt0Q/iMZOXX+TmKYBBXHnRWIccXfw yGVzYACz5MWyJh/7XcJOSNZfFt/8FcsR4PdvJXy5pLeah7iIZylnYJhTjW+/wH6bev5S Y2hgt7vrt8MHOrVkWASVpL+RAV1dzobEVRfQIaBoNdwvEMZSw6gn3thoWzje0fogiZ/z wZjqFHIiV/Iaw4irzaThync7xmPiDZMIIps+Szo4dofEjJ9Bn9jxr0KTvq3MsJ3+WsM6 nRsw== X-Forwarded-Encrypted: i=1; AJvYcCWROsyx6Gzqt7f8wpGIdKcVpE9mJzHYLLNPM2/w/Ael68UjPE3UPefJ80n9Xm8W+TNxwtUwMz+AZB5Z0z8=@vger.kernel.org X-Gm-Message-State: AOJu0YzPGhAMA1yuH/WOIQwbSC5RvWTHDdzfte2/rGiNFvxb2zA/QJ0z SjIKoJ7RfNPeIS25rTZmjxZfkLfPAU1LAw1ib6DrBrtuCw+2sot3oP/BgfavVbrs7s2sMJ4wKV4 61tylYCyoIUmScQ== X-Received: from dlbdt13.prod.google.com ([2002:a05:7022:258d:b0:121:7b2a:193d]) (user=jasonmiu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:2397:b0:11b:9386:a3c5 with SMTP id a92af1059eb24-1244b395f25mr900028c88.48.1768518050280; Thu, 15 Jan 2026 15:00:50 -0800 (PST) Date: Thu, 15 Jan 2026 15:00:45 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260115230047.1220580-1-jasonmiu@google.com> Subject: [PATCH v6 0/2] Make KHO Stateless From: Jason Miu To: Alexander Graf , Andrew Morton , Baoquan He , Changyuan Lyu , David Matlack , David Rientjes , Jason Gunthorpe , Jason Miu , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" 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 v5 [1]: - Cleaned up header inclusions - Rebased to the latest linux-next [1] https://lore.kernel.org/lkml/20260113053524.84186-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 | 144 ++++- 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, 560 insertions(+), 473 deletions(-) create mode 100644 include/linux/kho_radix_tree.h base-commit: 9b7977f9e39b7768c70c2aa497f04e7569fd3e00 -- 2.52.0.457.g6b5491de43-goog