Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pci: Decouple HK_FLAG_WQ and HK_FLAG_DOMAIN cpumask fetch

To prepare for supporting each feature of the housekeeping cpumask
toward cpuset, prepare each of the HK_FLAG_* entries to move to their
own cpumask with enforcing to fetch them individually. The new
constraint is that multiple HK_FLAG_* entries can't be mixed together
anymore in a single call to housekeeping cpumask().

This will later allow, for example, to runtime modify the cpulist passed
through "isolcpus=", "nohz_full=" and "rcu_nocbs=" kernel boot
parameters.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://lore.kernel.org/r/20220207155910.527133-2-frederic@kernel.org

authored by

Frederic Weisbecker and committed by
Peter Zijlstra
9d42ea0d e6df4ead

+16 -5
+16 -5
drivers/pci/pci-driver.c
··· 350 350 const struct pci_device_id *id) 351 351 { 352 352 int error, node, cpu; 353 - int hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ; 354 353 struct drv_dev_and_id ddi = { drv, dev, id }; 355 354 356 355 /* ··· 367 368 * device is probed from work_on_cpu() of the Physical device. 368 369 */ 369 370 if (node < 0 || node >= MAX_NUMNODES || !node_online(node) || 370 - pci_physfn_is_probed(dev)) 371 + pci_physfn_is_probed(dev)) { 371 372 cpu = nr_cpu_ids; 372 - else 373 + } else { 374 + cpumask_var_t wq_domain_mask; 375 + 376 + if (!zalloc_cpumask_var(&wq_domain_mask, GFP_KERNEL)) { 377 + error = -ENOMEM; 378 + goto out; 379 + } 380 + cpumask_and(wq_domain_mask, 381 + housekeeping_cpumask(HK_FLAG_WQ), 382 + housekeeping_cpumask(HK_FLAG_DOMAIN)); 383 + 373 384 cpu = cpumask_any_and(cpumask_of_node(node), 374 - housekeeping_cpumask(hk_flags)); 385 + wq_domain_mask); 386 + free_cpumask_var(wq_domain_mask); 387 + } 375 388 376 389 if (cpu < nr_cpu_ids) 377 390 error = work_on_cpu(cpu, local_pci_probe, &ddi); 378 391 else 379 392 error = local_pci_probe(&ddi); 380 - 393 + out: 381 394 dev->is_probed = 0; 382 395 cpu_hotplug_enable(); 383 396 return error;