diff mbox

[RFC/RFT,1/3] PCI: Introduce pci_bus_find_numa_node()

Message ID 20170426100619.31758-1-lorenzo.pieralisi@arm.com
State Superseded
Headers show

Commit Message

Lorenzo Pieralisi April 26, 2017, 10:06 a.m. UTC
Create an empty stub, to be populated by firmware methods, to
retrieve the NUMA node for a given pci_bus. No functional change
introduced.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pci.c   | 6 ++++++
 include/linux/pci.h | 1 +
 2 files changed, 7 insertions(+)

Comments

Vadim Lomovtsev May 12, 2017, 12:44 p.m. UTC | #1
Hi Lorenzo,

Are there any news related to these patches ?

WBR,
Vadim
Lorenzo Pieralisi May 12, 2017, 3:50 p.m. UTC | #2
Hi Vadim,

On Fri, May 12, 2017 at 05:44:05AM -0700, Vadim Lomovtsev wrote:
> Hi Lorenzo,
> 
> Are there any news related to these patches ?

Not really, I have not received any feedback but I was expecting some
to make progress here. Have you tested it ?

Please let me know, thanks !

Lorenzo
Vadim Lomovtsev May 12, 2017, 5:18 p.m. UTC | #3
Hi Lorenzo

On Fri, May 12, 2017 at 04:50:40PM +0100, Lorenzo Pieralisi wrote:
> Hi Vadim,
> 
> On Fri, May 12, 2017 at 05:44:05AM -0700, Vadim Lomovtsev wrote:
> > Hi Lorenzo,
> > 
> > Are there any news related to these patches ?
> 
> Not really, I have not received any feedback but I was expecting some
> to make progress here. Have you tested it ?
>
> Please let me know, thanks !

Not yet. Plan to test them after weekend and will get back to you.

> 
> Lorenzo

WBR,
Vadim
Vadim Lomovtsev May 15, 2017, 12:57 p.m. UTC | #4
On Fri, May 12, 2017 at 10:18:46AM -0700, Vadim Lomovtsev wrote:
Hi Lorenzo,

> Hi Lorenzo
> 
> On Fri, May 12, 2017 at 04:50:40PM +0100, Lorenzo Pieralisi wrote:
> > Hi Vadim,
> > 
> > On Fri, May 12, 2017 at 05:44:05AM -0700, Vadim Lomovtsev wrote:
> > > Hi Lorenzo,
> > > 
> > > Are there any news related to these patches ?
> > 
> > Not really, I have not received any feedback but I was expecting some
> > to make progress here. Have you tested it ?
> >
> > Please let me know, thanks !
> 
> Not yet. Plan to test them after weekend and will get back to you.
>

Here is the results of testing you patches at dual-socketed board
with Cavium ThunderX SoC.

Each boot kernel boot with acpi=force argument.

1. The 4.12-rc1 couldn't find rootfs partition so can't be tested.
2.1  The 4.11 without your patch set 0 to numa node for pci device
  cat /sys/bus/pci/devices/*/numa_node
  got zeroes here for all devices
2.2 The 4.11 with your patches applied set -1 to numa_node for all pci devices
  same command provides "-1"

So looking at your patches..

At the patch 1/3 you implemented pci_bus_find_numa_node function:

+int pci_bus_find_numa_node(struct pci_bus *bus)
+{
+	return NUMA_NO_NODE;
+}

Then at the 2/3 patch it is called from pci_register_host_bridge:
@@ -770,6 +770,7 @@ int pci_register_host_bridge(struct pci_host_bridge *bridge)
[..]
+	set_dev_node(&bus->dev, pci_bus_find_numa_node(bus));

I suppose that is why I'm seeing those -1 in the numa_node field.

And at the patch 3/3 you implemented acpi_pci_bus_find_numa_node function
 +int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
which implements actual work of getting numa node value,
but it seems that nodoby calls it, isn't it ?

Don't we need to update pci_bus_find_numa_node with proper calling
of acpi_pci_bus_find_numa_node() ?

> > 
> > Lorenzo
> 
> WBR,
> Vadim

WBR,
Vadim
Lorenzo Pieralisi May 15, 2017, 1:05 p.m. UTC | #5
On Mon, May 15, 2017 at 05:57:11AM -0700, Vadim Lomovtsev wrote:
> On Fri, May 12, 2017 at 10:18:46AM -0700, Vadim Lomovtsev wrote:
> Hi Lorenzo,
> 
> > Hi Lorenzo
> > 
> > On Fri, May 12, 2017 at 04:50:40PM +0100, Lorenzo Pieralisi wrote:
> > > Hi Vadim,
> > > 
> > > On Fri, May 12, 2017 at 05:44:05AM -0700, Vadim Lomovtsev wrote:
> > > > Hi Lorenzo,
> > > > 
> > > > Are there any news related to these patches ?
> > > 
> > > Not really, I have not received any feedback but I was expecting some
> > > to make progress here. Have you tested it ?
> > >
> > > Please let me know, thanks !
> > 
> > Not yet. Plan to test them after weekend and will get back to you.
> >
> 
> Here is the results of testing you patches at dual-socketed board
> with Cavium ThunderX SoC.
> 
> Each boot kernel boot with acpi=force argument.
> 
> 1. The 4.12-rc1 couldn't find rootfs partition so can't be tested.
> 2.1  The 4.11 without your patch set 0 to numa node for pci device
>   cat /sys/bus/pci/devices/*/numa_node
>   got zeroes here for all devices
> 2.2 The 4.11 with your patches applied set -1 to numa_node for all pci devices
>   same command provides "-1"
> 
> So looking at your patches..
> 
> At the patch 1/3 you implemented pci_bus_find_numa_node function:
> 
> +int pci_bus_find_numa_node(struct pci_bus *bus)
> +{
> +	return NUMA_NO_NODE;
> +}
> 
> Then at the 2/3 patch it is called from pci_register_host_bridge:
> @@ -770,6 +770,7 @@ int pci_register_host_bridge(struct pci_host_bridge *bridge)
> [..]
> +	set_dev_node(&bus->dev, pci_bus_find_numa_node(bus));
> 
> I suppose that is why I'm seeing those -1 in the numa_node field.
> 
> And at the patch 3/3 you implemented acpi_pci_bus_find_numa_node function
>  +int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
> which implements actual work of getting numa node value,
> but it seems that nodoby calls it, isn't it ?
> 
> Don't we need to update pci_bus_find_numa_node with proper calling
> of acpi_pci_bus_find_numa_node() ?

Yes:

https://lkml.org/lkml/2017/4/26/211

Apologies for wasting your time, v2 coming with the actual call,
please have a look.

Thanks,
Lorenzo
diff mbox

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7904d02..2de9162 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -12,6 +12,7 @@ 
 #include <linux/delay.h>
 #include <linux/dmi.h>
 #include <linux/init.h>
+#include <linux/numa.h>
 #include <linux/of.h>
 #include <linux/of_pci.h>
 #include <linux/pci.h>
@@ -5235,6 +5236,11 @@  int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)
 #endif
 #endif
 
+int pci_bus_find_numa_node(struct pci_bus *bus)
+{
+	return NUMA_NO_NODE;
+}
+
 /**
  * pci_ext_cfg_avail - can we access extended PCI config space?
  *
diff --git a/include/linux/pci.h b/include/linux/pci.h
index eb3da1a..9e62462 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1481,6 +1481,7 @@  static inline int acpi_pci_bus_find_domain_nr(struct pci_bus *bus)
 #endif
 int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent);
 #endif
+int pci_bus_find_numa_node(struct pci_bus *bus);
 
 /* some architectures require additional setup to direct VGA traffic */
 typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,