All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferran <ferran.duarri@me.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org, linux-pci@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM
Date: Wed, 30 Sep 2026 09:15:42 +0200	[thread overview]
Message-ID: <33c0b32e-11eb-4e3e-bb59-e349289c498b@me.com> (raw)

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;
 }
 

             reply	other threads:[~2026-09-30  7:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  7:15 Ferran [this message]
2026-09-30  7:23 ` [RFC PATCH] x86/PCI: Use the only online node for root buses with no _PXM sashiko-bot

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=33c0b32e-11eb-4e3e-bb59-e349289c498b@me.com \
    --to=ferran.duarri@me.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.