Linux-PCI Archive on
 help / color / Atom feed
From: Yunsheng Lin <>
To: <>
Cc: <>, <>,
	<>, <>,
	<>, <>,
	<>, <>
Subject: [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE
Date: Sat, 19 Oct 2019 14:45:43 +0800
Message-ID: <> (raw)

As the disscusion in [1]:
A PCI device really _MUST_ have a node assigned. It is possible to
have a PCI bridge shared between two nodes, such that the PCI
devices have equidistance. But the moment you scale this out, you
either get devices that are 'local' to a package while having
multiple packages, or if you maintain a single bridge in a big
system, things become so slow it all doesn't matter anyway.
Assigning a node (one of the shared) is, in the generic ase of
multiple packages, the better solution over assigning all nodes.

As pci_device_add() will assign the pci device' node according to
the bus the device is on, which is decided by pcibus_to_node().
Currently different arch may implement the pcibus_to_node() based
on bus->sysdata or bus device' node, which has the same node as
the bridge device.

And for devices behind another bridge case, the child bus device
is setup with proper parent bus device and inherit its parent'
sysdata in pci_alloc_child_bus(), so the pcie device under the
child bus should have the same node as the parent bridge when
device_add() is called, which will set the node to its parent's
node when the child device' node is NUMA_NO_NODE.

So this patch only warns about the case when a host bridge device
is registered with a node of NO_NODE in pci_register_host_bridge().
And it only warns about that when there are more than one numa
nodes in the system.


Signed-off-by: Yunsheng Lin <>
 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3d5271a..22be96a 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -927,6 +927,9 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
 	list_add_tail(&bus->node, &pci_root_buses);
+	if (nr_node_ids > 1 && dev_to_node(bus->bridge) == NUMA_NO_NODE)
+		dev_err(bus->bridge, FW_BUG "No node assigned on NUMA capable HW by BIOS. Please contact your vendor for updates.\n");
 	return 0;

             reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19  6:45 Yunsheng Lin [this message]
2019-10-19  8:34 ` Christoph Hellwig
2019-10-21  4:05   ` Yunsheng Lin
2019-10-22 13:55     ` Robin Murphy
2019-10-23  8:24       ` Yunsheng Lin
2019-10-22 21:04 ` Bjorn Helgaas
2019-10-23  8:22   ` Yunsheng Lin
2019-10-23 17:10     ` Bjorn Helgaas
2019-10-24  9:20       ` Michal Hocko
2019-10-24 17:40         ` Bjorn Helgaas
2019-10-25  8:16           ` Michal Hocko
2019-10-25  8:51             ` Yunsheng Lin
2019-10-24  9:39       ` Yunsheng Lin
2019-10-24 10:16       ` Robin Murphy
2019-10-25 12:51         ` Bjorn Helgaas

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-PCI Archive on

Archives are clonable:
	git clone --mirror linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ \
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone