Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641301 > unrolled thread

Re: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node() implementation

Started byZhou Wang <wangzhou1@hisilicon.com>
First post2017-05-15 08:20 +0200
Last post2017-05-16 05:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node()  implementation Zhou Wang <wangzhou1@hisilicon.com> - 2017-05-15 08:20 +0200
    Re: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node()  implementation Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-05-15 11:20 +0200
      Re: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node()  implementation Zhou Wang <wangzhou1@hisilicon.com> - 2017-05-16 05:30 +0200

#1641301 — Re: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node() implementation

FromZhou Wang <wangzhou1@hisilicon.com>
Date2017-05-15 08:20 +0200
SubjectRe: [RFC/RFT PATCH 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node() implementation
Message-ID<tHhwl-4kQ-7@gated-at.bofh.it>
On 2017/4/26 18:06, Lorenzo Pieralisi wrote:
> The introduction of pci_bus_find_numa_node(pci_bus) allows at PCI
> host bridge registration to detect the NUMA node for a given
> struct pci_bus.dev. Implement an ACPI method that, through
> the struct pci_bus.bridge ACPI companion, retrieve and return
> the NUMA node corresponding to a given struct pci_bus.dev.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  drivers/pci/pci-acpi.c | 20 ++++++++++++++++++++
>  include/linux/pci.h    |  6 ++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index 0018603..915da79 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -10,6 +10,7 @@
>  #include <linux/delay.h>
>  #include <linux/init.h>
>  #include <linux/irqdomain.h>
> +#include <linux/numa.h>
>  #include <linux/pci.h>
>  #include <linux/msi.h>
>  #include <linux/pci_hotplug.h>
> @@ -853,6 +854,25 @@ struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>  	return irq_find_matching_fwnode(fwnode, DOMAIN_BUS_PCI_MSI);
>  }
>  
> +int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
> +{
> +	int node = NUMA_NO_NODE;
> +	struct device *bridge = get_device(bus->bridge);
> +
> +	if (!bridge)
> +		return node;
> +
> +	if (has_acpi_companion(bridge)) {
> +		struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);
> +
> +		node = acpi_get_node(adev->handle);
> +	}
> +
> +	put_device(bridge);
> +
> +	return node;
> +}
> +

It seems there is no function to call this, am I right?

Another question is that:
in the latest IORT revision C, "Proximity domain" has been added to the IORT spec.
So when we enable NUMA for a PCIe device, should we also consider this?

Thanks,
Zhou

>  static int __init acpi_pci_init(void)
>  {
>  	int ret;
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 9e62462..b40d095 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1481,6 +1481,12 @@ 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
> +#ifdef CONFIG_ACPI
> +int acpi_pci_bus_find_numa_node(struct pci_bus *bus);
> +#else
> +static inline int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
> +{ return NUMA_NO_NODE; }
> +#endif
>  int pci_bus_find_numa_node(struct pci_bus *bus);
>  
>  /* some architectures require additional setup to direct VGA traffic */
> 

[toc] | [next] | [standalone]


#1641457

FromLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date2017-05-15 11:20 +0200
Message-ID<tHkkz-6aZ-27@gated-at.bofh.it>
In reply to#1641301
On Mon, May 15, 2017 at 02:13:47PM +0800, Zhou Wang wrote:
> On 2017/4/26 18:06, Lorenzo Pieralisi wrote:
> > The introduction of pci_bus_find_numa_node(pci_bus) allows at PCI
> > host bridge registration to detect the NUMA node for a given
> > struct pci_bus.dev. Implement an ACPI method that, through
> > the struct pci_bus.bridge ACPI companion, retrieve and return
> > the NUMA node corresponding to a given struct pci_bus.dev.
> > 
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> >  drivers/pci/pci-acpi.c | 20 ++++++++++++++++++++
> >  include/linux/pci.h    |  6 ++++++
> >  2 files changed, 26 insertions(+)
> > 
> > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> > index 0018603..915da79 100644
> > --- a/drivers/pci/pci-acpi.c
> > +++ b/drivers/pci/pci-acpi.c
> > @@ -10,6 +10,7 @@
> >  #include <linux/delay.h>
> >  #include <linux/init.h>
> >  #include <linux/irqdomain.h>
> > +#include <linux/numa.h>
> >  #include <linux/pci.h>
> >  #include <linux/msi.h>
> >  #include <linux/pci_hotplug.h>
> > @@ -853,6 +854,25 @@ struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
> >  	return irq_find_matching_fwnode(fwnode, DOMAIN_BUS_PCI_MSI);
> >  }
> >  
> > +int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
> > +{
> > +	int node = NUMA_NO_NODE;
> > +	struct device *bridge = get_device(bus->bridge);
> > +
> > +	if (!bridge)
> > +		return node;
> > +
> > +	if (has_acpi_companion(bridge)) {
> > +		struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);
> > +
> > +		node = acpi_get_node(adev->handle);
> > +	}
> > +
> > +	put_device(bridge);
> > +
> > +	return node;
> > +}
> > +
> 
> It seems there is no function to call this, am I right?

Sorry, I missed updating pci_bus_find_numa_node() while reshuffling
the code, apologies.

I will repost shortly.

> Another question is that: in the latest IORT revision C, "Proximity
> domain" has been added to the IORT spec.  So when we enable NUMA for a
> PCIe device, should we also consider this?

That's for the SMMU device.

Lorenzo

> Thanks,
> Zhou
> 
> >  static int __init acpi_pci_init(void)
> >  {
> >  	int ret;
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index 9e62462..b40d095 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -1481,6 +1481,12 @@ 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
> > +#ifdef CONFIG_ACPI
> > +int acpi_pci_bus_find_numa_node(struct pci_bus *bus);
> > +#else
> > +static inline int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
> > +{ return NUMA_NO_NODE; }
> > +#endif
> >  int pci_bus_find_numa_node(struct pci_bus *bus);
> >  
> >  /* some architectures require additional setup to direct VGA traffic */
> > 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1642194

FromZhou Wang <wangzhou1@hisilicon.com>
Date2017-05-16 05:30 +0200
Message-ID<tHBln-cD-7@gated-at.bofh.it>
In reply to#1641457
On 2017/5/15 17:17, Lorenzo Pieralisi wrote:
> On Mon, May 15, 2017 at 02:13:47PM +0800, Zhou Wang wrote:
>> On 2017/4/26 18:06, Lorenzo Pieralisi wrote:
>>> The introduction of pci_bus_find_numa_node(pci_bus) allows at PCI
>>> host bridge registration to detect the NUMA node for a given
>>> struct pci_bus.dev. Implement an ACPI method that, through
>>> the struct pci_bus.bridge ACPI companion, retrieve and return
>>> the NUMA node corresponding to a given struct pci_bus.dev.
>>>
>>> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>> ---
>>>  drivers/pci/pci-acpi.c | 20 ++++++++++++++++++++
>>>  include/linux/pci.h    |  6 ++++++
>>>  2 files changed, 26 insertions(+)
>>>
>>> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
>>> index 0018603..915da79 100644
>>> --- a/drivers/pci/pci-acpi.c
>>> +++ b/drivers/pci/pci-acpi.c
>>> @@ -10,6 +10,7 @@
>>>  #include <linux/delay.h>
>>>  #include <linux/init.h>
>>>  #include <linux/irqdomain.h>
>>> +#include <linux/numa.h>
>>>  #include <linux/pci.h>
>>>  #include <linux/msi.h>
>>>  #include <linux/pci_hotplug.h>
>>> @@ -853,6 +854,25 @@ struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus)
>>>  	return irq_find_matching_fwnode(fwnode, DOMAIN_BUS_PCI_MSI);
>>>  }
>>>  
>>> +int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
>>> +{
>>> +	int node = NUMA_NO_NODE;
>>> +	struct device *bridge = get_device(bus->bridge);
>>> +
>>> +	if (!bridge)
>>> +		return node;
>>> +
>>> +	if (has_acpi_companion(bridge)) {
>>> +		struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);
>>> +
>>> +		node = acpi_get_node(adev->handle);
>>> +	}
>>> +
>>> +	put_device(bridge);
>>> +
>>> +	return node;
>>> +}
>>> +
>>
>> It seems there is no function to call this, am I right?
> 
> Sorry, I missed updating pci_bus_find_numa_node() while reshuffling
> the code, apologies.
> 
> I will repost shortly.
> 
>> Another question is that: in the latest IORT revision C, "Proximity
>> domain" has been added to the IORT spec.  So when we enable NUMA for a
>> PCIe device, should we also consider this?
> 
> That's for the SMMU device.

Sorry, this is another problem. Now I get it that this Proximity domain
is for SMMU itself.

Thanks,
Zhou

> 
> Lorenzo
> 
>> Thanks,
>> Zhou
>>
>>>  static int __init acpi_pci_init(void)
>>>  {
>>>  	int ret;
>>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>>> index 9e62462..b40d095 100644
>>> --- a/include/linux/pci.h
>>> +++ b/include/linux/pci.h
>>> @@ -1481,6 +1481,12 @@ 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
>>> +#ifdef CONFIG_ACPI
>>> +int acpi_pci_bus_find_numa_node(struct pci_bus *bus);
>>> +#else
>>> +static inline int acpi_pci_bus_find_numa_node(struct pci_bus *bus)
>>> +{ return NUMA_NO_NODE; }
>>> +#endif
>>>  int pci_bus_find_numa_node(struct pci_bus *bus);
>>>  
>>>  /* some architectures require additional setup to direct VGA traffic */
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> .
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web