lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 12 Dec 2011 21:14:25 +0200
From:	Pekka Enberg <penberg@...nel.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Sasha Levin <levinsasha928@...il.com>
Subject: Re: [patch 0/3] kvm tool: Serial emulation overhaul

On Mon, Dec 12, 2011 at 7:20 PM, Ingo Molnar <mingo@...e.hu> 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?

On Mon, Dec 12, 2011 at 8:40 PM, Pekka Enberg <penberg@...nel.org> wrote:
> 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:

[snip]

Looking at drivers/tty/serial/8250.c, we have:

static void serial8250_console_putchar(struct uart_port *port, int ch)
{
        struct uart_8250_port *up =
                container_of(port, struct uart_8250_port, port);

        wait_for_xmitr(up, UART_LSR_THRE);
        serial_out(up, UART_TX, ch);
}

in tools/kvm/hw/serial.c::serial8250_out() we do:

        case UART_TX:
                if (!(dev->lcr & UART_LCR_DLAB)) {
                        char *addr = data;

                        if (!(dev->mcr & UART_MCR_LOOP))
                                term_putc(CONSOLE_8250, addr, size, dev->id);
                        /* else FIXME: Inject data into rcv path for LOOP */

                        if (++dev->txcnt == 16)
                                dev->lsr &= ~(UART_LSR_TEMT | UART_LSR_THRE);
                        break;

which clears UART_LSR_THRE after 16 characters. UART_LSR_THRE is only
enabled in serial8250__update_consoles() and serial8250_update_irq()
which are completely bound by TIMER_INTERVAL_NS.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ