Skip to contentSkip to conversation

x86: fix broken flush_tlb_others_ipi()

PATCH Applied Suresh Siddha 2 participants 3 messages Jan 14, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix broken flush_tlb_others_ipi()

This commit broke flush_tlb_others_ipi() causing boot hangs on a 16 logical cpu system.

Quoted 5 lines
	commit 4595f9620cda8a1e973588e743cf5f8436dd20c6
	Author: Rusty Russell <[email protected]>
	Date:   Sat Jan 10 21:58:09 2009 -0800

	    x86: change flush_tlb_others to take a const struct cpumask

This change resulted in sending the invalidate tlb vector to the sender itself causing the hang. flush_tlb_others_ipi() should exclude the sender itself from the destination list.

---

arch/x86/kernel/tlb_64.c +1 -1
index 2d971a3..53289e1 100644
@@ -188,7 +188,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
 	 * We have to send the IPI only to
 	 * CPUs affected.
 	 */
-	send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR_START + sender);
+	send_IPI_mask(f->flush_cpumask, INVALIDATE_TLB_VECTOR_START + sender);
 
 	while (!cpumask_empty(to_cpumask(f->flush_cpumask)))
 		cpu_relax();
#1 lore raw
Quoted 21 lines · Suresh Siddha

This commit broke flush_tlb_others_ipi() causing boot hangs on a 16 logical cpu system.

Quoted 5 lines
	commit 4595f9620cda8a1e973588e743cf5f8436dd20c6
	Author: Rusty Russell <[email protected]>
	Date:   Sat Jan 10 21:58:09 2009 -0800

	    x86: change flush_tlb_others to take a const struct cpumask

This change resulted in sending the invalidate tlb vector to the sender itself causing the hang. flush_tlb_others_ipi() should exclude the sender itself from the destination list.

---

arch/x86/kernel/tlb_64.c +0 -0
index 2d971a3..53289e1 100644

arch/x86/kernel/tlb_64.c static void flush_tlb_others_ipi(const struct cpumask *cpumask, · line 194

Quoted 8 lines
arch/x86/kernel/tlb_64.c +1 -1
@@ -188,7 +188,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
 	 * We have to send the IPI only to
 	 * CPUs affected.
 	 */
-	send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR_START + sender);
+	send_IPI_mask(f->flush_cpumask, INVALIDATE_TLB_VECTOR_START + sender);
 
 	while (!cpumask_empty(to_cpumask(f->flush_cpumask)))
 		cpu_relax();

Good catch! This might explain one of the hangs i was seeing on a test-system.

Ingo

Applied
#2 lore raw
In reply to Suresh Siddha
Quoted 7 lines · Suresh Siddha

This commit broke flush_tlb_others_ipi() causing boot hangs on a 16 logical cpu system.

Quoted 4 lines
	commit 4595f9620cda8a1e973588e743cf5f8436dd20c6
	Author: Rusty Russell <[email protected]>
	Date:   Sat Jan 10 21:58:09 2009 -0800
Quoted 7 lines
Quoted 1 line

x86: change flush_tlb_others to take a const struct cpumask

This change resulted in sending the invalidate tlb vector to the sender itself causing the hang. flush_tlb_others_ipi() should exclude the sender itself from the destination list.

applied to tip/cpus4096, thanks Suresh!

Ingo