public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH printk v3 0/6] printk: cleanup buffer handling
@ 2022-12-21 20:26 John Ogness
  2022-12-21 20:26 ` [PATCH printk v3 1/6] printk: move size limit macros into internal.h John Ogness
                   ` (5 more replies)
  0 siblings, 6 replies; 31+ messages in thread
From: John Ogness @ 2022-12-21 20:26 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel,
	Greg Kroah-Hartman

Hi,

This is v3 of a series to cleanup console buffer handling and
prepare for code sharing with the upcoming threaded/atomic
consoles. v2 is here [0].

The main purpose of the series is to introduce 2 new lockless
functions to handle all console formatting of printk messages. These
functions can then be used from any context, which is important for
the upcoming threaded/atomic consoles. The series also helps to
cleanup some of the internal printk interfaces and cleanly separate
formatting code from outputting code.

Changes since v2:

- Put size limit macros and definitions of structs console_buffers
  and console_message in printk/internal.h instead of
  linux/console.h.

- Provide a better description for @dropped field of struct console.
  (Only a small change in patch 3/6. I kept Petr's Reviewed-by tag.)

- Move the static struct console_buffers inside
  console_emit_next_record() since this function will not be used by
  the threaded/atomic consoles.

- Rename various functions and struct fields:

    msg_print_dropped()       ->  console_prepend_dropped()

    console_buffers.ext_text  ->  console_buffers.outbuf

    console_buffers.text      ->  console_buffers.scratchbuf

- console_buffers.outbuf is always the output buffer.

- Change struct console_message fields:

    removed: char *outbuf

    removed: bool is_extmsg

    added:   u64 outbuf_seq

    added:   unsigned long dropped

- All struct console_message fields are now output fields. No input
  fields.

- Implement console_prepend_dropped() as suggested by pmladek: shift
  existing message and insert dropped message.

- For console_get_next_message():

    add all input variables as arguments

    do not rely on locking (no @console argument)

    do not prepend "dropped messages", let the caller deal with that

    implement as suggested by pmladek: use different buffers for
    ringbuffer reading so that @outbuf is always the output buffer
    in the end

- Do not use struct console_buffers for devkmsg. (It is not a
  console).

John Ogness

[0] https://lore.kernel.org/lkml/20221123231400.614679-1-john.ogness@linutronix.de

John Ogness (4):
  printk: move size limit macros into internal.h
  printk: introduce struct console_buffers
  printk: introduce console_get_next_message() and console_message
  printk: introduce console_prepend_dropped() for dropped messages

Thomas Gleixner (2):
  console: Use BIT() macros for @flags values
  console: Document struct console

 include/linux/console.h  | 100 ++++++++++++-----
 include/linux/printk.h   |   2 -
 kernel/printk/internal.h |  45 ++++++++
 kernel/printk/printk.c   | 237 +++++++++++++++++++++++----------------
 4 files changed, 260 insertions(+), 124 deletions(-)


base-commit: 6b2b0d839acaa84f05a77184370f793752e786e9
-- 
2.30.2


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

end of thread, other threads:[~2023-01-05 13:58 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 20:26 [PATCH printk v3 0/6] printk: cleanup buffer handling John Ogness
2022-12-21 20:26 ` [PATCH printk v3 1/6] printk: move size limit macros into internal.h John Ogness
2023-01-02 14:06   ` Petr Mladek
2022-12-21 20:27 ` [PATCH printk v3 2/6] console: Use BIT() macros for @flags values John Ogness
2022-12-21 20:27 ` [PATCH printk v3 3/6] console: Document struct console John Ogness
2022-12-21 20:27 ` [PATCH printk v3 4/6] printk: introduce struct console_buffers John Ogness
2023-01-02 15:15   ` Petr Mladek
2023-01-03 10:04   ` John Ogness
2022-12-21 20:27 ` [PATCH printk v3 5/6] printk: introduce console_get_next_message() and console_message John Ogness
2022-12-22 15:41   ` John Ogness
2023-01-03 14:04     ` Petr Mladek
2023-01-03 14:57       ` John Ogness
2023-01-03 15:55         ` Petr Mladek
2023-01-04 10:26           ` John Ogness
2023-01-04 10:42             ` Petr Mladek
2023-01-02 15:52   ` Petr Mladek
2023-01-03 15:41     ` John Ogness
2023-01-03 10:02   ` John Ogness
2023-01-03 14:05     ` Petr Mladek
2022-12-21 20:27 ` [PATCH printk v3 6/6] printk: introduce console_prepend_dropped() for dropped messages John Ogness
2023-01-02 16:19   ` Petr Mladek
2023-01-03 10:20     ` John Ogness
2023-01-03 13:29       ` Petr Mladek
2023-01-03 13:44         ` John Ogness
2023-01-03 14:16           ` Petr Mladek
2023-01-03 15:00             ` John Ogness
2023-01-03 16:13               ` Petr Mladek
2023-01-04  9:06                 ` John Ogness
2023-01-04 10:33                   ` Petr Mladek
2023-01-05 13:14   ` kernel test robot
2023-01-05 13:55     ` John Ogness

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