linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] printk: new log_cont implementation
@ 2020-08-19 23:26 John Ogness
  2020-08-19 23:26 ` [RFC PATCH 1/5] printk: implement pr_cont_t John Ogness
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: John Ogness @ 2020-08-19 23:26 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Petr Mladek, Sergey Senozhatsky, Steven Rostedt,
	Greg Kroah-Hartman, Thomas Gleixner, Sergey Senozhatsky,
	linux-kernel

Hello,

My recent series [0] to perform log_cont handling by the readers
was not received well, mainly because of the blank lines in the
output for existing dmesg and journalctl tools. This caused a
discussion about alternative methods of handling log_cont. This
RFC series is the result of that discussion.

Rather than storing individual log_cont parts into the ringbuffer,
this series will buffer the parts until flushed or the message is
complete (just as mainline does it now). The difference to mainline
is that a new API is used that allows the printk subsystem to
effectively track the caller while making use of separate
per-caller buffers.

The API is designed such that:

1. The API calls map clearly to the mainline log_cont calls. This
   is important because all current log_cont users will need to
   be updated.

2. The underlying implementation can be changed/improved at some
   later time without requiring the code of log_cont users to
   change (again).

The mainline log_cont syntax:

    printk(KERN_INFO "text");
    printk(KERN_CONT " continued");
    printk(KERN_CONT "\n");

The new RFC log_cont syntax:

    pr_cont_t c;

    pr_cont_begin(&c, KERN_INFO "text");
    pr_cont_append(&c, " continued");
    pr_cont_end(&c);

Note that both methods can co-exist until all users of the old
mechanism have been converted over.

For this RFC series, 10KiB of memory are set aside to allow up to 10
simultaneous log_cont users. Obviously that might be adjusted based
on the number of CPUs or whatever.

The first patch implements the new log_cont mechanism. The following
4 patches convert existing log_cont user code, with each patch
taking on a more complex example.

This RFC series not only improves log_cont output generally, but
also addresses the lockless printk issue related to log_cont.

John Ogness

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

John Ogness (5):
  printk: implement pr_cont_t
  sysrq: use pr_cont_t for cont messages
  workqueue: use pr_cont_t for cont messages
  locking/selftest: use pr_cont_t for cont messages
  lockdep: use pr_cont_t for cont messages

 based on next-20200819

 drivers/tty/sysrq.c      |   8 +-
 include/linux/printk.h   |  19 ++
 kernel/locking/lockdep.c | 463 +++++++++++++++++++++++----------------
 kernel/printk/printk.c   | 137 ++++++++++++
 kernel/workqueue.c       |  71 +++---
 lib/locking-selftest.c   |  85 +++----
 6 files changed, 519 insertions(+), 264 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2020-08-25 15:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 23:26 [RFC PATCH 0/5] printk: new log_cont implementation John Ogness
2020-08-19 23:26 ` [RFC PATCH 1/5] printk: implement pr_cont_t John Ogness
2020-08-20  0:33   ` Joe Perches
2020-08-20  7:44     ` David Laight
2020-08-20  7:59       ` Joe Perches
2020-08-20  8:49         ` David Laight
2020-08-20  9:18           ` John Ogness
2020-08-20 16:03       ` Joe Perches
2020-08-20 10:16   ` Petr Mladek
2020-08-20 12:33     ` David Laight
2020-08-25 13:10       ` Petr Mladek
2020-08-25 13:38         ` David Laight
2020-08-25 15:32           ` Petr Mladek
2020-08-24  2:08     ` Sergey Senozhatsky
2020-08-24  5:37   ` Sergey Senozhatsky
2020-08-19 23:26 ` [RFC PATCH 2/5] sysrq: use pr_cont_t for cont messages John Ogness
2020-08-20  1:03   ` Linus Torvalds
2020-08-20 17:48     ` Joe Perches
2020-08-20 17:53       ` Linus Torvalds
2020-08-20 22:11       ` John Ogness
2020-08-20 22:36         ` Joe Perches
2020-08-19 23:26 ` [RFC PATCH 3/5] workqueue: " John Ogness
2020-08-19 23:26 ` [RFC PATCH 4/5] locking/selftest: " John Ogness
2020-08-19 23:26 ` [RFC PATCH 5/5] lockdep: " John Ogness

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).