public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH printk v2 0/7] printk: cleanup buffer handling
@ 2022-11-23 23:13 John Ogness
  2022-11-23 23:13 ` [PATCH printk v2 1/7] printk: Move buffer size defines John Ogness
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: John Ogness @ 2022-11-23 23:13 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel,
	Greg Kroah-Hartman

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


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-12-08  9:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23 23:13 [PATCH printk v2 0/7] printk: cleanup buffer handling John Ogness
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox