On Sun, Jan 6, 2019 at 5:46 AM Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> One more thing - our serial console is dreadfully slow (
> https://github.com/cloudius-systems/osv/issues/921). So I think even
> printing bootchart info slows things by 3-5 ms. Without bootchart the 17 ms
> number drops to 12-11 ms.
>

This is firecrackers serial port driver:

https://github.com/firecracker-microvm/firecracker/blob/master/devices/src/legacy/serial.rs

I can't say I understand all of this of this code, but from cursory look I
think that:
1. It doesn't use any sophisticated FIFO. There is just one byte of THR
(transmit hold register).
2. It *does* support output interrupts: It checks bit 2 of the IER
(interrupt enable register) - IER_THR, and triggers interrupt. Since I'm
guessing they didn't implement this feature by accident, it is likely that
Linux is using it, i.e., instead of busy-wait loop to wait for the empty
bit (as in our putchar()) it goes to sleep, and allows the hypervisor to
work on the output - assuming the exit (which we already had when we wrote
the byte) wasn't enough. I don't know how it works on firecracker.

If you can run Linux on firecracker too, you can compare the slowness of
the serial console - output 1000 characters (or whatever) in the guess, and
measure how slow it is. If Linux isn't faster than OSv on this, there's not
much we can probably is. If Linux is much faster than OSv, then maybe these
THR interrupts are indeed the reason.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to