Skip to contentSkip to conversation

improve scalability of 2.4.21 fpassist

PATCH Applied John Hawkes 2 participants 2 messages Jul 3, 2003 – Jul 29, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 improve scalability of 2.4.21 fpassist

This change has already made its way into linux-2.5.72-ia64-031619.diff. Here is the diff relative to 2.4.21 + linux-2.4.21-ia64-030702.diff.

This patch *significantly* improves the scalability of handle_fpu_swa() when multiple CPUs are generating concurrent fp-assist traps. The original algorithm produces cacheline ping-ponging for the cacheline that contains fpu_swa_count. This new algorithm only dirties fpu_sw_count when the printk() is about to occur, rather than on every fpassist trap, which throttles the ping-ponging to no more than five per second.

John Hawkes

arch/ia64/kernel/traps.c +2 -1
diff -X /home/hawkes/Patches/ignore.dirs -Naur linux-2.4.21-ia64/arch/ia64/kernel/traps.c linux-2.4.21-ia64-fp/arch/ia64/kernel/traps.c
@@ -335,8 +335,9 @@
 
 	if (jiffies - last_time > 5*HZ)
 		fpu_swa_count = 0;
-	if ((++fpu_swa_count < 5) && !(current->thread.flags & IA64_THREAD_FPEMU_NOPRINT)) {
+	if ((fpu_swa_count < 4) && !(current->thread.flags & IA64_THREAD_FPEMU_NOPRINT)) {
 		last_time = jiffies;
+		++fpu_swa_count;
 		printk(KERN_WARNING "%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n",
 		       current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, isr);
 	}
#1 lore raw
Quoted 10 lines · John Hawkes

This change has already made its way into linux-2.5.72-ia64-031619.diff. Here is the diff relative to 2.4.21 + linux-2.4.21-ia64-030702.diff.

This patch *significantly* improves the scalability of handle_fpu_swa() when multiple CPUs are generating concurrent fp-assist traps. The original algorithm produces cacheline ping-ponging for the cacheline that contains fpu_swa_count. This new algorithm only dirties fpu_sw_count when the printk() is about to occur, rather than on every fpassist trap, which throttles the ping-ponging to no more than five per second.

I applied this for 2.4. Thanks!

Bjorn