Linux PCI subsystem development
 help / color / mirror / Atom feed
* [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM
@ 2026-09-30  7:15 Ferran
  2026-09-30  7:23 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Ferran @ 2026-09-30  7:15 UTC (permalink / raw)
  To: Bjorn Helgaas, Thomas Gleixner, x86, linux-pci
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel

When a host bridge has no _PXM and the Northbridge fallback finds
nothing either, pci_acpi_root_get_node() leaves every root bus at
NUMA_NO_NODE. With exactly one node online that isn't really unknown,
there's only one possible answer.

Seen on an ASRock B760M-ITX/D4 (i9-14900KF). nvidia-fs calls
pcibus_to_node() directly and warns "error retrieving numa node" four
times per boot, once for the GPU and once per NVMe. Rewriting the
per-device numa_node attribute from udev doesn't help, since
pcibus_to_node() reads the bus value set at enumeration.

Fall back to first_online_node when num_online_nodes() == 1. Systems
with more than one node are unaffected.

With this applied the warnings are gone over four boots. I didn't
observe pcibus_to_node() itself at the call site, there's no sysfs
file for it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ferran Duarri <ferran.duarri@me.com>
---
Only user I've got is the out-of-tree nvidia-fs, hence the RFC. The
single-node condition is the same reasoning as Bjorn's 2019 "PCI: Warn
about host bridge device when its numa node is NO_NODE" change. Fine to
drop this if callers are expected to cope with NUMA_NO_NODE.

 arch/x86/pci/acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 7cd5388ed..2ae31c3e7 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -463,6 +463,13 @@ static int pci_acpi_root_get_node(struct acpi_pci_root *root)
 	if (node != NUMA_NO_NODE && !node_online(node))
 		node = NUMA_NO_NODE;
 
+	/*
+	 * One online node means there's only one possible answer, so don't
+	 * leave the bus at NUMA_NO_NODE just because firmware didn't say.
+	 */
+	if (node == NUMA_NO_NODE && num_online_nodes() == 1)
+		node = first_online_node;
+
 	return node;
 }
 

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

* Re: [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM
  2026-09-30  7:15 [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM Ferran
@ 2026-09-30  7:23 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-30  7:23 UTC (permalink / raw)
  To: Ferran; +Cc: linux-pci

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] x86/pci: num_online_nodes() check breaks NUMA locality for offline nodes
- [Low] x86/pci: faking NUMA locality to suppress out-of-tree module warnings
--

commit 8ab24ac3406319565e845067f7c37f528237c0fa
Author: Ferran <ferran.duarri@me.com>

x86/PCI: Use the only online node for root buses with no _PXM

When a host bridge has no _PXM and the Northbridge fallback finds
nothing either, pci_acpi_root_get_node() leaves every root bus at
NUMA_NO_NODE. This patch forces the node to first_online_node when
there is exactly one node online.

> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 7cd5388edc756..cf7f9b879b42f 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -463,6 +463,13 @@ static int pci_acpi_root_get_node(struct acpi_pci_root *root)
>  	if (node != NUMA_NO_NODE && !node_online(node))
>  		node = NUMA_NO_NODE;
>  
> +	/*
> +	 * One online node means there's only one possible answer, so don't
> +	 * leave the bus at NUMA_NO_NODE just because firmware didn't say.
> +	 */
> +	if (node == NUMA_NO_NODE && num_online_nodes() == 1)
> +		node = first_online_node;

[Severity: Medium]
Could this num_online_nodes() check incorrectly bind a root bus on an offline
node to the first online node?

During system boot or PCI enumeration on multi-node setups where a subset of
nodes are temporarily offline, num_online_nodes() could evaluate to 1. This
overrides the NUMA_NO_NODE state with first_online_node.

When the offline node is brought online, would this permanent binding cause
cross-node memory allocations and latency?

Would checking num_possible_nodes() == 1 or nr_node_ids == 1 be safer here
to avoid corrupting topology on hotplug systems?

[Severity: Low]
Is it appropriate to advertise node 0 instead of NUMA_NO_NODE for root buses
lacking _PXM?

The commit message states this change is to accommodate the out-of-tree
nvidia-fs driver. NUMA_NO_NODE (-1) is the architecturally correct state when
hardware/ACPI lacks proximity data, and core subsystems handle it gracefully.

Should hardware topology be faked in the core kernel to work around an
out-of-tree driver?

> +
>  	return node;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/33c0b32e-11eb-4e3e-bb59-e349289c498b@me.com?part=1

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

end of thread, other threads:[~2026-09-30  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30  7:15 [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM Ferran
2026-09-30  7:23 ` sashiko-bot

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