Re: [PATCH printk 16/18] printk: Use struct cons_text_buf

From: Sergey Senozhatsky
Date: Sat Sep 24 2022 - 07:35:20 EST


On (22/09/24 02:10), John Ogness wrote:
> Date: Sat, 24 Sep 2022 02:10:52 +0206
> From: John Ogness <john.ogness@xxxxxxxxxxxxx>
> To: Petr Mladek <pmladek@xxxxxxxx>
> Cc: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>, Steven Rostedt
> <rostedt@xxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>,
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: [PATCH printk 16/18] printk: Use struct cons_text_buf
> Message-Id: <20220924000454.3319186-17-john.ogness@xxxxxxxxxxxxx>
>
> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> Replace the separately allocated output buffers with a single instance of
> struct cons_text_buf.
>
> Note that the buffer size of devkmsg_user.text_buf, when replaced with
> cons_text_buf.text, reduces from CONSOLE_EXT_LOG_MAX to CONSOLE_LOG_MAX.
> However, the buffer is only used to read ringbuffer records, which have
> a maximum size of LOG_LINE_MAX (CONSOLE_LOG_MAX - PREFIX_MAX).
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>

[..]
> @@ -2765,7 +2766,7 @@ static bool console_emit_next_record(struct console *con, char *text, char *ext_
> console_lock_spinning_enable();
>
> stop_critical_timings(); /* don't trace print latency */
> - call_console_driver(con, write_text, len, dropped_text);

+ /* Extended consoles do not print "dropped messages". */ perhaps?

> + call_console_driver(con, write_text, len, extmsg ? NULL : txtbuf->dropped_text);