From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (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 70F061F03D7 for ; Fri, 6 Feb 2026 02:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770344072; cv=none; b=b6X/BFWtk01Oe6HxIgIxqnj0hwexqalFMkimjrTFw5l8c+IT/WV0YW4iFtIbbEv1XgvfedYdCAUD1YRFPzKpZI3VB/kH9ScZLdR8zBo+EgeNGEqhEa2+JFBgq7v7nTqmPvLxDG5A+JAmQnwmHxUsjQeEF/25j/B1WjTX6GeN5TY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770344072; c=relaxed/simple; bh=obfPWuhDcrBmH6piWNu6+HKBQAw5hQGCcUTKNmi/TCo=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=hW181JkNA0Zjufb/pXCioUF+ZBG6fRz4Pas73rjdjexZ+++K7A5FLs8AXEb5K6calIAEAxvXb4tXfQe5fboC1zOMrLh3I08mRWWBdGMFwoTXGmwXFiMCoSVWxhugoN2D1nIRnm60hb5jDO7+7EO5edXHysw3414kgSE7m7oc/eo= 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=ANjQAXJv; arc=none smtp.client-ip=74.125.82.201 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="ANjQAXJv" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2b8335e64e0so1446923eec.1 for ; Thu, 05 Feb 2026 18:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770344071; x=1770948871; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=wOMvatFmTNuXEwXOvg3h5CBCiVV90WJG1wSdmd/lsBo=; b=ANjQAXJvUq9YVB7QjslHhv0crQMMu6+JrRkRLodOxrxPr7knV/aHOElH3U4ifBVkYg kyNVYglV1am+Lle0qbhRmP5qB5dJkeGhnk/DkEp2Vr+dS6CGjsEjxAhe5hui/FD9CfLB DJo/L5IYgdAEH4VBMkwu8ji0MZx9BINmNSQeUq015Qh+3J/fPDvIE3HTufVAa7GS1ZE6 BGXvTOvsfrhDifCVDZZ4g0LKCAE9v/jJToO99RacQLs4Dg76g5Aj2//mVCHWfj1UqxT8 AXJbgTzRbinV3ez5RaLemhGxb6Sw25k47E/Ln6CnlfEjE9KZ1GytOY7t5ZKqz1tnSofA 1+ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770344071; x=1770948871; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wOMvatFmTNuXEwXOvg3h5CBCiVV90WJG1wSdmd/lsBo=; b=N/UF1JC5HKU0OVOpNTfvH94WvJ2Pn/gQlmDSFCYSyvWGLfRMq+qojh9FCzJcUSSl1y acWCBqb61lU4F8C+MALQjM03u05bgm4pX2jTF0aACsBJcDR07JJBGEWx34I4kyEgu+YZ ySwEGjHB00n7gqAceGVPcixQ+DvbanebZ/Xzuad+uLYXiGJowEjTuqK9EWoIhA4vrEq2 +jQD9FnMdYrF6MLsa5DU9YHptbCp03Ax/qnNCIrthRLAUVeJSGIIZb1dlyN3cj90BOK0 YZVq1tPVjTXehplOehXdqWRV3CbdwHgzRpmxywLQYAx/xnM0HaAxlUsynSS4tn18NLQr N0+w== X-Forwarded-Encrypted: i=1; AJvYcCW6enborL1VM5eESfeaIJYQHMSFg8jNjtzcF1s+V03h8bhtIXashJMpB18qwXLvQcWdhhH5EfuPoTvDzcU=@vger.kernel.org X-Gm-Message-State: AOJu0YydL+QN86lCFuX884W7XNdt3hAAUekE4kKM3gJQOR4WOHt4orMN qSBtQRTYnFDryATRjAUlLklYAAwVG4gNWHwhjyCH3sYK/V6+PzygfI5nJMWLkfywrTZW0XLTnaw 5JMQGAr9Qp8pGWQ== X-Received: from dybgu5.prod.google.com ([2002:a05:7301:2285:b0:2ae:51e3:c162]) (user=jasonmiu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:693c:2d8c:b0:2b7:1c58:dca6 with SMTP id 5a478bee46e88-2b85646d9c4mr658234eec.6.1770344071405; Thu, 05 Feb 2026 18:14:31 -0800 (PST) Date: Thu, 5 Feb 2026 18:14:26 -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.53.0.rc2.204.g2597b5adb4-goog Message-ID: <20260206021428.3386442-1-jasonmiu@google.com> Subject: [PATCH v9 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 v8 [1]: - A small refactoring of __kho_radix_walk_tree(). [1] https://lore.kernel.org/lkml/20260130005739.3163049-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 | 672 ++++++++++---------- kernel/liveupdate/kexec_handover_debugfs.c | 23 - kernel/liveupdate/kexec_handover_internal.h | 3 - kernel/liveupdate/luo_core.c | 12 +- tools/testing/selftests/kho/init.c | 20 - 10 files changed, 571 insertions(+), 450 deletions(-) create mode 100644 include/linux/kho_radix_tree.h base-commit: 9845cf73f7db6094c0d8419d6adb848028f4a921 -- 2.53.0.rc2.204.g2597b5adb4-goog