From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 EE6272F4A0C for ; Wed, 10 Jun 2026 01:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781055932; cv=none; b=pAEfLy23dBDn/tUQbD+joMvH0uL/fVA0bYciAjKMS5sI7nyPkD+JiMcbMxjYf5SFm+Aak/RCCqISTUyeP3MtFogaA6JuTy3+K36TyKjug/ZaRhg5Dmd18NJkj0og3L2THoN5vgRtYLaP1GGQ6mg3jipyAJ2U6sJfOas5Vwp2pAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781055932; c=relaxed/simple; bh=MJBp72SKMyjsUAzv3mWv2+ZOo0GNt4ALfKXaxFLidIQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=S5w5HBDKsYLznkPI/uIuHRXJq8kAPmkmBOt7ZZGb6Wfd8mbX/8YJDo5ViVgu0idNLAZXXZxJDEWe+5xW6ZM1xO9lhByYjoF2gFe9FfLX61G8KngZwEqe4nxrv5lQLovNTfta5iVzNeC3moUupUF8Q/kN+mMSaLeQlMLXOxQXbYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=QIVfsdJd; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="QIVfsdJd" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-9159951f05aso719408785a.0 for ; Tue, 09 Jun 2026 18:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1781055926; x=1781660726; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=u+GrVwUVnyXoJ3l/Ws8SD/JHytJBmijCAuGEqrIfnVw=; b=QIVfsdJdxRWb4Oy76ocNAdd0yvYcwrWH5A9XsF2lC8tFbL2vwY1D1hVcfrlgoLofRI EYwycpkhujwSGdjaOT25GTGEFuAL0SaaRxUaa8iZ/GzWHAYJSi0SUY2ihotN8ITcbMiF nIRQ4dZa2CO+llnHJTGqodzQ3LPVMNYTedaieYmnUm8pU7eAeuaZ11qlEGNLxRuXrxRx wycCnfcCTieT7z4Aed1zQMn/2vOV5Q8L5Tmv52Vo/fkJ41CdzL/LlKC+JWYTH716JtWk 3ahNiOvmEBlYnAZUzJJJMnfiXhooV1X+ENefRC3mEgtnPEm3X08ZXzPRKYsB04f0RVNy YfwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781055926; x=1781660726; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u+GrVwUVnyXoJ3l/Ws8SD/JHytJBmijCAuGEqrIfnVw=; b=K2wcyIJnU1ogNlo/hPXiDBjMVsoZnAzWVrSkjkfUsZubUerXANTcLqxEll6JNIjcrE zVzByO5KihxZMTKBM3XpgJCgs2IMzTujSTmG/WllOO6zKa9BO/g0e8cigcjCW4oSew1Y 4dyAlE4kRGuRG3Zhc40qTdxtdWtVFBD7/ACVbT8OEA2qZzI3yHRrvRyDsCoJDjxKPeF8 xAZKFSVi16LPw2jM4vKJkIVCxLb4s34t0clR3AqSpkoTYjD9sOAPtN3OzCoarFy/UJjX cawRt07yZu70/lbuHZfidWEA24qPW7aTZVydCewZZjJ2f9V6YrN56B/IbWkZn4zOGKRu ZaJw== X-Forwarded-Encrypted: i=1; AFNElJ9V9+BPK02Sb4LSPzFna9IenGQV/YDJoynMTm6z15sYO0SJSay1jVX0XH5VPPrPmP7KqZ9F+MIomrxBxzo=@vger.kernel.org X-Gm-Message-State: AOJu0YwTA7n5Ck2Z/7Mwz4kLMNoOSHWB3yMtXxoo4QDrehSvXYzcrTus v8AOCQBMbb8f1iLZn2ihiXkZ8aPupYIj6YHjj3TSyy4MEZ2oqWO5B8soNzkyjEZLTNw= X-Gm-Gg: Acq92OGqUgURlkfDi7DJXwAKm11tYNtaC+ysuiyDZySVMNpkpp9hIFrYUh7+6Mdqjfs oea6+Oa92JwLOpm+T4xG8EMPxFohmFt2/VlZi3Z31dE1wn3LuLssflOKdO5lRM13sIx2q8dDWNE 2ZuskYHwdy3o2AnVH9fEtRtY7Oq9WE/ZkagapNaaOrzLjoFtIp5sjnDIkwJlaz5F3pZKKesVPbG b4na0rEkNjakFs2TJjaxzttJIDO4JIAq0HmD0zIgeY/1gmdI1t87m2yaS2ed8q++N3nTzldzUYa 4GnJE9SyjSYuLVAsWEnV0am/hZPWKOcg8Wo2weeeOC1hgp9+OSyTLTBosVOcYqiVHFodVCQdltb asB4P1srZ7V2U38Sk7P/APyPwIchly2xxYvKKc6Hp9qoHzcknnbvbFEq9ZRWty2GFNtgWYmHL8G O1phIw1Mtj4PN7EnR9qTlKwXsB7ow4QNTA2lRw7okljOmE5eR7ZLQjWhhN+YQdfcjDhuxrpJgEo kDaE8sKI4QNOqiAuA4NWG4= X-Received: by 2002:ac8:7612:0:b0:517:a02f:171a with SMTP id d75a77b69052e-517a02f1d7bmr208979241cf.36.1781055925526; Tue, 09 Jun 2026 18:45:25 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F.lan (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51775c07e91sm205923261cf.4.2026.06.09.18.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 18:45:24 -0700 (PDT) From: Gregory Price To: linux-mm@kvack.org Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, kernel-team@meta.com, corbet@lwn.net, skhan@linuxfoundation.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rafael@kernel.org, lenb@kernel.org, gregkh@linuxfoundation.org, dakr@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, rdunlap@infradead.org, feng.tang@linux.alibaba.com, dapeng1.mi@linux.intel.com, elver@google.com, kuba@kernel.org, ebiggers@kernel.org, lirongqing@baidu.com, paulmck@kernel.org, gourry@gourry.net, dave.jiang@intel.com, jic23@kernel.org, xueshuai@linux.alibaba.com, kai.huang@intel.com Subject: [RFC PATCH 0/3] mm/numa: reserve standby NUMA nodes for runtime claiming Date: Tue, 9 Jun 2026 21:45:14 -0400 Message-ID: <20260610014517.253609-1-gourry@gourry.net> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A NUMA node must be "possible" at __init time to be usable later; a node that is not described at boot cannot be brought online afterwards. For memory tiering or isolation it is sometimes desirable to spread hotplug memory (CXL, GPU, virtio-mem, ...) across more nodes than firmware describes. Additionally, some memory devices may provide more than a single class of memory and need flexibility to redefine the effective topology at runtime instead of depending on BIOS. This series adds a way to reserve empty "standby" NUMA nodes at boot so drivers can place hotplugged memory on distinct nodes later, at runtime, without those nodes being described by BIOS. Using the feature ================= A standby node is an empty, offline-but-possible NUMA node: at boot it has no memory and no CPUs. A driver claims one at runtime, brings memory online on it, and releases it when done. This series adds 3 ways to reserve standby nodes. - numa=standby=N Boot parameter. Reserve N extra empty nodes. Platform independent; works with or without ACPI. - CONFIG_ACPI_NUMA_STANDBY_NODES=N Reserve N extra empty nodes on ACPI systems (honoured only when firmware produces a usable NUMA configuration). - CONFIG_ACPI_NUMA_ADD_CFMWS_NODES=K Reserve K extra empty nodes per CXL Fixed Memory Window (CEDT CFMWS), for CXL topologies that want several nodes behind one window. All three default to off (0 / unset). Reserved nodes show up in /sys/devices/system/node/possible but not .../online until a driver claims one and onlines memory on it. Testing ======= Built and booted under QEMU (virtme-ng) across a matrix of boot parameters and topologies: - Each reservation source, individually and combined: reserved nodes appear as possible-but-offline with no memory, claim/release round-trips correctly, and node distances are sane. The CFMWS path was exercised with an emulated CXL Type-3 device presenting a CEDT/CFMWS. - Fallback: when ACPI NUMA init does not produce a usable config, no standby nodes are reserved. - NUMA emulation (numa=fake): renumbers the node space. Standby nodes are created only after the (possibly emulated) topology is final, so their ids can never alias emulated nodes. numa=fake boots cleanly with the feature enabled and behaves identically to a baseline kernel without this series. Tested with CONFIG_NUMA_EMU both enabled and disabled, and with and without numa=fake on the command line. - Default-off builds behave identically to a baseline kernel. Gregory Price (3): mm/numa: add exclusive node pool and numa=standby boot parameter acpi/numa: add CONFIG_ACPI_NUMA_STANDBY_NODES acpi/numa: add CONFIG_ACPI_NUMA_ADD_CFMWS_NODES .../admin-guide/kernel-parameters.txt | 8 ++ arch/x86/mm/numa.c | 2 + drivers/acpi/numa/Kconfig | 35 ++++++ drivers/acpi/numa/srat.c | 14 ++- drivers/base/arch_numa.c | 2 + include/linux/numa.h | 14 +++ include/linux/numa_memblks.h | 3 + mm/numa.c | 90 +++++++++++++ mm/numa_memblks.c | 118 +++++++++++++++++- 9 files changed, 284 insertions(+), 2 deletions(-) -- 2.54.0