Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit190113b

Browse files
committed
x86/apic/vector: Fix ordering in vector assignment
Prarit reported that depending on the affinity setting the ' irq $N: Affinity broken due to vector space exhaustion.'message is showing up in dmesg, but the vector space on the CPUs in theaffinity mask is definitely not exhausted.Shung-Hsi provided traces and analysis which pinpoints the problem:The ordering of trying to assign an interrupt vector inassign_irq_vector_any_locked() is simply wrong if the interrupt data has avalid node assigned. It does: 1) Try the intersection of affinity mask and node mask 2) Try the node mask 3) Try the full affinity mask 4) Try the full online maskObviously #2 and #3 are in the wrong order as the requested affinitymask has to take precedence.In the observed cases #1 failed because the affinity mask did not containCPUs from node 0. That made it allocate a vector from node 0, therebybreaking affinity and emitting the misleading message.Revert the order of #2 and #3 so the full affinity mask without the nodeintersection is tried before actually affinity is broken.If no node is assigned then only the full affinity mask and if that failsthe full online mask is tried.Fixes:d6ffc6a ("x86/vector: Respect affinity mask in irq descriptor")Reported-by: Prarit Bhargava <prarit@redhat.com>Reported-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Tested-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>Cc: stable@vger.kernel.orgLink:https://lore.kernel.org/r/87ft4djtyp.fsf@nanos.tec.linutronix.de
1 parent06c5fe9 commit190113b

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

‎arch/x86/kernel/apic/vector.c‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,24 @@ static int assign_irq_vector_any_locked(struct irq_data *irqd)
273273
conststructcpumask*affmsk=irq_data_get_affinity_mask(irqd);
274274
intnode=irq_data_get_node(irqd);
275275

276-
if (node==NUMA_NO_NODE)
277-
gotoall;
278-
/* Try the intersection of @affmsk and node mask */
279-
cpumask_and(vector_searchmask,cpumask_of_node(node),affmsk);
280-
if (!assign_vector_locked(irqd,vector_searchmask))
281-
return0;
282-
/* Try the node mask */
283-
if (!assign_vector_locked(irqd,cpumask_of_node(node)))
284-
return0;
285-
all:
276+
if (node!=NUMA_NO_NODE) {
277+
/* Try the intersection of @affmsk and node mask */
278+
cpumask_and(vector_searchmask,cpumask_of_node(node),affmsk);
279+
if (!assign_vector_locked(irqd,vector_searchmask))
280+
return0;
281+
}
282+
286283
/* Try the full affinity mask */
287284
cpumask_and(vector_searchmask,affmsk,cpu_online_mask);
288285
if (!assign_vector_locked(irqd,vector_searchmask))
289286
return0;
287+
288+
if (node!=NUMA_NO_NODE) {
289+
/* Try the node mask */
290+
if (!assign_vector_locked(irqd,cpumask_of_node(node)))
291+
return0;
292+
}
293+
290294
/* Try the full online mask */
291295
returnassign_vector_locked(irqd,cpu_online_mask);
292296
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp