[lkml]   [2019]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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);


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


 \ /
  Last update: 2019-03-04 10:24    [W:0.167 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site