Skip to contentSkip to conversation

genirq: Honor user provided affinity

PATCH Applied Shay Drory 2 participants 2 messages Aug 6, 2024 – Aug 7, 2024

Subsystems (2)
lore
Share & tools
lore

Shay Drory

author
#0 lore raw

PATCH 1/1 genirq: Honor user provided affinity

Currently, whenever user is providing affinity for an IRQ, genirq layer is ignoring it and assigning the default affinity for the IRQ. Fix it by honor the user input.

Fixes 45ddcecbfa94 ("genirq: Use affinity hint in irqdesc allocation")
---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
index 07e99c936ba5..1dee88ba0ae4 100644
@@ -530,6 +530,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
 				flags = IRQD_AFFINITY_MANAGED |
 					IRQD_MANAGED_SHUTDOWN;
 			}
+			flags |= IRQD_AFFINITY_SET;
 			mask = &affinity->mask;
 			node = cpu_to_node(cpumask_first(mask));
 			affinity++;
Signature · 1 line
2.38.1
merge bot Applied
#1 lore raw

[tip: irq/urgent] genirq/irqdesc: Honor caller provided affinity in alloc_desc()

The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     edbbaae42a56f9a2b39c52ef2504dfb3fb0a7858
Gitweb:        https://git.kernel.org/tip/edbbaae42a56f9a2b39c52ef2504dfb3fb0a7858
Author:        Shay Drory <[email protected]>
AuthorDate:    Tue, 06 Aug 2024 10:20:44 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 07 Aug 2024 17:27:00 +02:00

genirq/irqdesc: Honor caller provided affinity in alloc_desc()

Currently, whenever a caller is providing an affinity hint for an interrupt, the allocation code uses it to calculate the node and copies the cpumask into irq_desc::affinity.

If the affinity for the interrupt is not marked 'managed' then the startup of the interrupt ignores irq_desc::affinity and uses the system default affinity mask.

Prevent this by setting the IRQD_AFFINITY_SET flag for the interrupt in the allocator, which causes irq_setup_affinity() to use irq_desc::affinity on interrupt startup if the mask contains an online CPU.

[ tglx: Massaged changelog ]

Fixes 45ddcecbfa94 ("genirq: Use affinity hint in irqdesc allocation")
---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
index 07e99c9..1dee88b 100644
@@ -530,6 +530,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
 				flags = IRQD_AFFINITY_MANAGED |
 					IRQD_MANAGED_SHUTDOWN;
 			}
+			flags |= IRQD_AFFINITY_SET;
 			mask = &affinity->mask;
 			node = cpu_to_node(cpumask_first(mask));
 			affinity++;