From: Frederic Weisbecker <frederic@kernel.org>
To: Nitesh Narayan Lal <nitesh@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
mtosatti@redhat.com, juri.lelli@redhat.com, abelits@marvell.com,
bhelgaas@google.com, linux-pci@vger.kernel.org,
rostedt@goodmis.org, mingo@kernel.org, peterz@infradead.org,
tglx@linutronix.de
Subject: Re: [Patch v1 2/3] PCI: prevent work_on_cpu's probe to execute on isolated CPUs
Date: Wed, 17 Jun 2020 01:22:18 +0200 [thread overview]
Message-ID: <20200616232217.GB4914@lenoir> (raw)
In-Reply-To: <20200610161226.424337-3-nitesh@redhat.com>
On Wed, Jun 10, 2020 at 12:12:25PM -0400, Nitesh Narayan Lal wrote:
> From: Alex Belits <abelits@marvell.com>
>
> pci_call_probe() prevents the nesting of work_on_cpu()
> for a scenario where a VF device is probed from work_on_cpu()
> of the Physical device.
> This patch replaces the cpumask used in pci_call_probe()
> from all online CPUs to only housekeeping CPUs. This is to
> ensure that there are no additional latency overheads
> caused due to the pinning of jobs on isolated CPUs.
>
> Signed-off-by: Alex Belits <abelits@marvell.com>
> Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
> ---
> drivers/pci/pci-driver.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index da6510af1221..449466f71040 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -12,6 +12,7 @@
> #include <linux/string.h>
> #include <linux/slab.h>
> #include <linux/sched.h>
> +#include <linux/sched/isolation.h>
> #include <linux/cpu.h>
> #include <linux/pm_runtime.h>
> #include <linux/suspend.h>
> @@ -333,6 +334,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
> const struct pci_device_id *id)
> {
> int error, node, cpu;
> + int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
> struct drv_dev_and_id ddi = { drv, dev, id };
>
> /*
> @@ -353,7 +355,8 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
> pci_physfn_is_probed(dev))
> cpu = nr_cpu_ids;
> else
> - cpu = cpumask_any_and(cpumask_of_node(node), cpu_online_mask);
> + cpu = cpumask_any_and(cpumask_of_node(node),
> + housekeeping_cpumask(hk_flags));
Looks like cpumask_of_node() is based on online CPUs. So that all
looks good. Thanks!
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
>
> if (cpu < nr_cpu_ids)
> error = work_on_cpu(cpu, local_pci_probe, &ddi);
> --
> 2.18.4
>
next prev parent reply other threads:[~2020-06-16 23:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 16:12 [PATCH v1 0/3] Preventing job distribution to isolated CPUs Nitesh Narayan Lal
2020-06-10 16:12 ` [Patch v1 1/3] lib: restricting cpumask_local_spread to only houskeeping CPUs Nitesh Narayan Lal
2020-06-10 16:12 ` [Patch v1 2/3] PCI: prevent work_on_cpu's probe to execute on isolated CPUs Nitesh Narayan Lal
2020-06-16 20:05 ` Bjorn Helgaas
2020-06-16 22:03 ` Nitesh Narayan Lal
2020-06-16 23:22 ` Frederic Weisbecker [this message]
2020-06-10 16:12 ` [Patch v1 3/3] net: restrict queuing of receive packets to housekeeping CPUs Nitesh Narayan Lal
2020-06-16 17:26 ` [PATCH v1 0/3] Preventing job distribution to isolated CPUs Marcelo Tosatti
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=20200616232217.GB4914@lenoir \
--to=frederic@kernel.org \
--cc=abelits@marvell.com \
--cc=bhelgaas@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=nitesh@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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).