Skip to content

Commit 69a18b1

Browse files
Alex BelitsPeter Zijlstra
authored andcommitted
PCI: Restrict probe functions to housekeeping CPUs
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 PF. Replace 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 <[email protected]> Signed-off-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 1abdfe7 commit 69a18b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/pci/pci-driver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/string.h>
1313
#include <linux/slab.h>
1414
#include <linux/sched.h>
15+
#include <linux/sched/isolation.h>
1516
#include <linux/cpu.h>
1617
#include <linux/pm_runtime.h>
1718
#include <linux/suspend.h>
@@ -333,6 +334,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
333334
const struct pci_device_id *id)
334335
{
335336
int error, node, cpu;
337+
int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
336338
struct drv_dev_and_id ddi = { drv, dev, id };
337339

338340
/*
@@ -353,7 +355,8 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
353355
pci_physfn_is_probed(dev))
354356
cpu = nr_cpu_ids;
355357
else
356-
cpu = cpumask_any_and(cpumask_of_node(node), cpu_online_mask);
358+
cpu = cpumask_any_and(cpumask_of_node(node),
359+
housekeeping_cpumask(hk_flags));
357360

358361
if (cpu < nr_cpu_ids)
359362
error = work_on_cpu(cpu, local_pci_probe, &ddi);

0 commit comments

Comments
 (0)