Skip to content

Commit 8049da6

Browse files
Nitesh Narayan LalKAGA-KOKO
authored andcommitted
scsi: megaraid_sas: Use irq_set_affinity_and_hint()
The driver uses irq_set_affinity_hint() specifically for the high IOPS queue interrupts for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides The driver enforces its own affinity to bind the high IOPS queue interrupts to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Change the megasas_set_high_iops_queue_affinity_hint function name to megasas_set_high_iops_queue_affinity_and_hint to clearly indicate that the function is setting both affinity and affinity_hint. Signed-off-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Sumit Saxena <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d34c54d commit 8049da6

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5720,7 +5720,7 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe)
57205720
"Failed to register IRQ for vector %d.\n", i);
57215721
for (j = 0; j < i; j++) {
57225722
if (j < instance->low_latency_index_start)
5723-
irq_set_affinity_hint(
5723+
irq_update_affinity_hint(
57245724
pci_irq_vector(pdev, j), NULL);
57255725
free_irq(pci_irq_vector(pdev, j),
57265726
&instance->irq_context[j]);
@@ -5763,7 +5763,7 @@ megasas_destroy_irqs(struct megasas_instance *instance) {
57635763
if (instance->msix_vectors)
57645764
for (i = 0; i < instance->msix_vectors; i++) {
57655765
if (i < instance->low_latency_index_start)
5766-
irq_set_affinity_hint(
5766+
irq_update_affinity_hint(
57675767
pci_irq_vector(instance->pdev, i), NULL);
57685768
free_irq(pci_irq_vector(instance->pdev, i),
57695769
&instance->irq_context[i]);
@@ -5894,22 +5894,25 @@ int megasas_get_device_list(struct megasas_instance *instance)
58945894
}
58955895

58965896
/**
5897-
* megasas_set_high_iops_queue_affinity_hint - Set affinity hint for high IOPS queues
5898-
* @instance: Adapter soft state
5899-
* return: void
5897+
* megasas_set_high_iops_queue_affinity_and_hint - Set affinity and hint
5898+
* for high IOPS queues
5899+
* @instance: Adapter soft state
5900+
* return: void
59005901
*/
59015902
static inline void
5902-
megasas_set_high_iops_queue_affinity_hint(struct megasas_instance *instance)
5903+
megasas_set_high_iops_queue_affinity_and_hint(struct megasas_instance *instance)
59035904
{
59045905
int i;
5905-
int local_numa_node;
5906+
unsigned int irq;
5907+
const struct cpumask *mask;
59065908

59075909
if (instance->perf_mode == MR_BALANCED_PERF_MODE) {
5908-
local_numa_node = dev_to_node(&instance->pdev->dev);
5910+
mask = cpumask_of_node(dev_to_node(&instance->pdev->dev));
59095911

5910-
for (i = 0; i < instance->low_latency_index_start; i++)
5911-
irq_set_affinity_hint(pci_irq_vector(instance->pdev, i),
5912-
cpumask_of_node(local_numa_node));
5912+
for (i = 0; i < instance->low_latency_index_start; i++) {
5913+
irq = pci_irq_vector(instance->pdev, i);
5914+
irq_set_affinity_and_hint(irq, mask);
5915+
}
59135916
}
59145917
}
59155918

@@ -5998,7 +6001,7 @@ megasas_alloc_irq_vectors(struct megasas_instance *instance)
59986001
instance->msix_vectors = 0;
59996002

60006003
if (instance->smp_affinity_enable)
6001-
megasas_set_high_iops_queue_affinity_hint(instance);
6004+
megasas_set_high_iops_queue_affinity_and_hint(instance);
60026005
}
60036006

60046007
/**

0 commit comments

Comments
 (0)