From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH printk v2 0/7] printk: cleanup buffer handling
Date: Thu, 24 Nov 2022 00:19:53 +0106 [thread overview]
Message-ID: <20221123231400.614679-1-john.ogness@linutronix.de> (raw)
Hi,
This is v2 of a series to cleanup buffer handling and prepare for
code sharing with the upcoming threaded/atomic consoles. v1 is
patches 13-18 of [0].
Changes since v1:
- Explain why console.h was chosen for buffer size defines.
- Keep DROPPED_TEXT_MAX define in printk.c.
- Put new BIT()-macro usage for console flags into its own commit.
- Modify descriptions for console flags as suggested.
- Add argument names and types to console callback definitions to
satisfy checkpatch.pl complaints.
- Avoid temporary usage of an ext_text/dropped_text union mid-series.
- Rename various structures, fields, and functions:
struct cons_text_buf -> struct console_buffers
struct cons_outbuf_desc -> struct console_message
cons_outbuf_desc.txtbuf -> console_message.cbufs
cons_outbuf_desc.len -> console_message.outbuf_len
cons_outbuf_desc.extmsg -> console_message.is_extmsg
cons_fill_outbuf() -> console_get_next_message()
cons_print_dropped() -> msg_print_dropped()
- Remove cons_outbuf_desc->dropped and make @dropped an argument of
msg_print_dropped() instead.
- Use "ext_text" and "ext_text_size" names for stack variables when
they refer to console_buffers->ext_text.
- Add a compile-time verification that DROPPED_TEXT_MAX is less than
CONSOLE_EXT_LOG_MAX - CONSOLE_LOG_MAX since the code expects that
a dropped+regular message will fit in console_buffers->ext_text.
- Replace hard-coded CONSOLE_LOG_MAX and CONSOLE_EXT_LOG_MAX usage
with sizeof() usage.
- For dropped messages, copy the regular message to append the
dropped message, instead of copying the dropped message to prepend
the regular message. Now it is not a hack and there is no need for
the __no_randomize_layout annotation.
- Reset console->dropped explicitly instead of relying on
msg_print_dropped() side-effects.
- Rework and expand comments and commit messages as requested.
John Ogness
[0] https://lore.kernel.org/lkml/20220924000454.3319186-1-john.ogness@linutronix.de
Thomas Gleixner (7):
printk: Move buffer size defines
console: Use BIT() macros for @flags values
console: Document struct console
printk: Add struct console_buffers
printk: Use struct console_buffers
printk: Use an output buffer descriptor struct for emit
printk: Handle dropped message smarter
include/linux/console.h | 139 ++++++++++++++++++-----
include/linux/printk.h | 2 -
kernel/printk/printk.c | 240 ++++++++++++++++++++++++++--------------
3 files changed, 269 insertions(+), 112 deletions(-)
base-commit: 11f1e536902b38bffab9913f8908309daf7e53e1
--
2.30.2
next reply other threads:[~2022-11-23 23:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 23:13 John Ogness [this message]
2022-11-23 23:13 ` [PATCH printk v2 1/7] printk: Move buffer size defines John Ogness
2022-11-24 11:09 ` Petr Mladek
2022-11-24 12:38 ` John Ogness
2022-11-24 14:42 ` Petr Mladek
2022-11-24 20:20 ` John Ogness
2022-11-23 23:13 ` [PATCH printk v2 2/7] console: Use BIT() macros for @flags values John Ogness
2022-11-24 11:14 ` Petr Mladek
2022-11-23 23:13 ` [PATCH printk v2 3/7] console: Document struct console John Ogness
2022-11-24 13:55 ` Petr Mladek
2022-11-23 23:13 ` [PATCH printk v2 4/7] printk: Add struct console_buffers John Ogness
2022-11-24 14:52 ` Petr Mladek
2022-11-24 20:22 ` John Ogness
2022-11-23 23:13 ` [PATCH printk v2 5/7] printk: Use " John Ogness
2022-11-24 15:22 ` Petr Mladek
2022-11-24 20:29 ` John Ogness
2022-11-23 23:13 ` [PATCH printk v2 6/7] printk: Use an output buffer descriptor struct for emit John Ogness
2022-11-24 18:00 ` Petr Mladek
2022-11-24 18:30 ` OFFLIST: " Petr Mladek
2022-11-24 21:15 ` John Ogness
2022-11-25 9:01 ` Petr Mladek
2022-11-25 10:49 ` John Ogness
2022-11-28 9:54 ` Petr Mladek
2022-11-23 23:14 ` [PATCH printk v2 7/7] printk: Handle dropped message smarter John Ogness
2022-12-07 12:50 ` Petr Mladek
2022-12-07 16:58 ` John Ogness
2022-12-08 9:29 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221123231400.614679-1-john.ogness@linutronix.de \
--to=john.ogness@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).