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  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, 4 Mar 2019 18:24:44 +0900
From:   Sergey Senozhatsky <>
To:     John Ogness <>
Cc:     Petr Mladek <>,,
        Peter Zijlstra <>,
        Sergey Senozhatsky <>,
        Steven Rostedt <>,
        Daniel Wang <>,
        Andrew Morton <>,
        Linus Torvalds <>,
        Greg Kroah-Hartman <>,
        Alan Cox <>,
        Jiri Slaby <>,
        Peter Feiner <>,,
        Sergey Senozhatsky <>
Subject: Re: [RFC PATCH v1 15/25] printk: print history for new consoles

On (02/26/19 16:22), John Ogness wrote:
> > This looks like an alien. The code is supposed to write one message
> > from the given buffer. And some huge job is well hidden there.
> This is a very simple implementation of a printk kthread. It probably
> makes more sense to have a printk kthread per console. That would allow
> fast consoles to not be penalized by slow consoles. Due to the
> per-console seq tracking, the code would already support it.

I believe we discussed "polling consoles" several times.

printk-kthread is one way to implement polling. Another one might
already be implemented in, probably, all serial drivers and we just
need to extend it a bit - polling from console's IRQ handler.

Serial drivers poll UART xmit buffer and print (usually) up to
`count' bytes:

	static irqreturn_t foo_irq_handler(int irq, void *id)
		int count = 512;

		while (count > 0 && !uart_circ_empty(xmit)) {
			wr_regb(port, TX, xmit->buf[xmit->tail]);
			xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);

		return IRQ_HANDLED;

So we can also grub NUM (e.g. max 64 entries) pending logbuf messages
and print them from device's isr.


Powered by blists - more mailing lists