Re: [patch 0/3] kvm tool: Serial emulation overhaul

From: Pekka Enberg
Date: Mon Dec 12 2011 - 13:40:12 EST


On Mon, Dec 12, 2011 at 7:20 PM, Ingo Molnar <mingo@xxxxxxx> wrote:
>> I'm seeing 1.5 usecs per character for this little benchmark:
>
> Interesting - what do you see with the top -b measurement i
> posted - can you see similar slowdowns?

ssh-4.2# time top -d 0.01 -n 10 -b

[snip]

real 0m2.935
user 0m0.006s
sys 0m0.049s

That's 9.7 usecs per character which is roughly 6x slowdown.

It seems to be related to interrupt handling because if I bump up
TIMER_INTEVAL_NS to 10 msec:

--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -412,7 +412,7 @@ found_kernel:
return ret;
}

-#define TIMER_INTERVAL_NS 1000000 /* 1 msec */
+#define TIMER_INTERVAL_NS 10000000 /* 10 msec */

serial console output slows down by the same 10x factor:

real 0m24.631s
user 0m0.007s
sys 0m0.025s

Lowering the interval too 100 usec speeds things up but unfortunately
chokes the serial layer rather quickly:

8 root RT [ 6.759222] serial8250: too much work for irq4
0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:1
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
13 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
14 root 20 0 0 0 0 S 0[ 6.759222] serial8250:
too much work for irq4
.0 0.0 0:00.00 kworker/2:0
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/2

So i'm pretty sure it's some bug in hw/serial.c that's limiting
character output by interrupts.

Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/