Commit fef1012e authored by David Mosberger's avatar David Mosberger

handle_fpu_swa() doesn't scale well if multiple CPUs need concurrent

fp assist.  The problem lies with concurrent, potentially frequent
updates of fpu_swa_count, which serves as the throttle for doing the
printk().  A frenzy of concurrent updates will produce a frenzy of
cacheline ping-ponging.

The fix is simple:

Only increment fpu_swa_count when the printk() is about to happen,
which limits the increment to no more than four times every five
seconds.
parent 2dc5d4a5
......@@ -330,8 +330,9 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment