From: Yunsheng Lin <linyunsheng@huawei.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<mhocko@kernel.org>, <peterz@infradead.org>,
<robin.murphy@arm.com>, <geert@linux-m68k.org>,
<gregkh@linuxfoundation.org>, <paul.burton@mips.com>
Subject: Re: [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE
Date: Thu, 24 Oct 2019 17:39:30 +0800 [thread overview]
Message-ID: <eb14d1ae-4077-0ce0-d64e-7c25f5aebbb6@huawei.com> (raw)
In-Reply-To: <20191023171039.GA173290@google.com>
On 2019/10/24 1:10, Bjorn Helgaas wrote:
> On Wed, Oct 23, 2019 at 04:22:43PM +0800, Yunsheng Lin wrote:
>> On 2019/10/23 5:04, Bjorn Helgaas wrote:
>>> On Sat, Oct 19, 2019 at 02:45:43PM +0800, Yunsheng Lin wrote:
>> And it seems a pci device's parent will always set to the bridge
>> device in pci_setup_device(), and device_add() which will set the
>> node to its parent's when the child device' node is NUMA_NO_NODE,
>> maybe we can add the bridge device' node checking to make sure
>> the pci device really does not have a node assigned, as below:
>>
>> if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE &&
>> dev_to_node(bus->bridge) == NUMA_NO_NODE)
>> dev_err(&bus->dev, FW_BUG "No node assigned on NUMA capable HW. Please contact your vendor for updates.\n");
>
> Anyway, would the attached patch work for you? I have it tentatively
> queued up on pci/enumeration for v5.5.
>
Yes, thanks for making the change when applying.
>>>
>>>
>>>> [1] https://lore.kernel.org/lkml/1568724534-146242-1-git-send-email-linyunsheng@huawei.com/
>>>>
>>>> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
>>>> ---
>>>> 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);
>>>> up_write(&pci_bus_sem);
>>>>
>>>> + 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;
>>>>
>>>> unregister:
>
> commit 8f8cf239c4f1
> Author: Yunsheng Lin <linyunsheng@huawei.com>
> Date: Sat Oct 19 14:45:43 2019 +0800
>
> PCI: Warn if no host bridge NUMA node info
>
> In pci_call_probe(), we try to run driver probe functions on the node where
> the device is attached. If we don't know which node the device is attached
> to, the driver will likely run on the wrong node. This will still work,
> but performance will not be as good as it could be.
>
> On NUMA systems, warn if we don't know which node a PCI host bridge is
> attached to. This is likely an indication that ACPI didn't supply a _PXM
> method or the DT didn't supply a "numa-node-id" property.
>
> [bhelgaas: commit log, check bus node]
> Link: https://lore.kernel.org/r/1571467543-26125-1-git-send-email-linyunsheng@huawei.com
> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 3d5271a7a849..40259c38d66a 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -897,6 +897,9 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
> else
> pr_info("PCI host bridge to bus %s\n", name);
>
> + if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
> + dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
> +
> /* Add initial resources to the bus */
> resource_list_for_each_entry_safe(window, n, &resources) {
> list_move_tail(&window->node, &bridge->windows);
>
> .
>
next prev parent reply other threads:[~2019-10-24 9:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-19 6:45 [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE Yunsheng Lin
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 [this message]
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:
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=eb14d1ae-4077-0ce0-d64e-7c25f5aebbb6@huawei.com \
--to=linyunsheng@huawei.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=paul.burton@mips.com \
--cc=peterz@infradead.org \
--cc=robin.murphy@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).