All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] printk: reimplement LOG_CONT handling
@ 2020-07-17 23:48 ` John Ogness
  0 siblings, 0 replies; 80+ messages in thread
From: John Ogness @ 2020-07-17 23:48 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Sergey Senozhatsky, Steven Rostedt,
	Linus Torvalds, Greg Kroah-Hartman, Peter Zijlstra,
	Thomas Gleixner, kexec, linux-kernel

Hello,

Here is the second series to rework the printk subsystem. This series
removes LOG_CONT handling from printk() callers, storing all LOG_CONT
parts individually in the ringbuffer. With this series, LOG_CONT
handling is moved to the ringbuffer readers that provide the record
contents to users (console printing, syslog, /dev/kmsg).

This change is necessary in order to support the upcoming move to a
fully lockless printk() implementation.

This series is in line with the agreements [0] made at the meeting
during LPC2019 in Lisbon, with 1 exception: For the /dev/kmsg
interface, empty line placeholder records are reported for the
LOG_CONT parts.

Using placeholders avoids tools such as systemd-journald from
erroneously reporting missed messages. However, it also means that
empty placeholder records are visible in systemd-journald logs and
displayed in tools such as dmesg.

The effect can be easily observed with the sysrq help:

$ echo h | sudo tee /proc/sysrq-trigger
$ sudo dmesg | tail -n 30
$ sudo journalctl -k -n 30

Providing the placeholder entries allows a userspace tool to identify
if records were actually lost. IMHO this an important feature. Its
side effect can be addressed by userspace tools if they change to
silently consume empty records.

For dump tools that process the ringbuffer directly (such as crash,
makedumpfile, kexec-tools), they will need to implement LOG_CONT
handling if they want to present clean continuous line messages.

Finally, by moving LOG_CONT handling from writers to readers, some
incorrect pr_cont() usage is revealed. Patch 4 of this series
addresses one such example.

This series is based on the printk git tree [1] printk-rework branch.

[0] https://lkml.kernel.org/r/87k1acz5rx.fsf@linutronix.de
[1] https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git (printk-rework branch)

John Ogness (4):
  printk: ringbuffer: support dataless records
  printk: store instead of processing cont parts
  printk: process cont records during reading
  ipconfig: cleanup printk usage

 kernel/printk/printk.c            | 569 ++++++++++++++++++++----------
 kernel/printk/printk_ringbuffer.c |  58 ++-
 kernel/printk/printk_ringbuffer.h |  15 +-
 net/ipv4/ipconfig.c               |  25 +-
 4 files changed, 434 insertions(+), 233 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2020-08-16  1:29 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 23:48 [PATCH 0/4] printk: reimplement LOG_CONT handling John Ogness
2020-07-17 23:48 ` John Ogness
2020-07-17 23:48 ` [PATCH 1/4] printk: ringbuffer: support dataless records John Ogness
2020-07-17 23:48   ` John Ogness
2020-07-20 14:49   ` John Ogness
2020-07-20 14:49     ` John Ogness
2020-07-17 23:48 ` [PATCH 2/4] printk: store instead of processing cont parts John Ogness
2020-07-17 23:48   ` John Ogness
2020-07-19 14:35   ` Sergey Senozhatsky
2020-07-19 14:35     ` Sergey Senozhatsky
2020-07-19 18:27     ` Linus Torvalds
2020-07-19 18:27       ` Linus Torvalds
2020-07-20  1:50       ` Sergey Senozhatsky
2020-07-20  1:50         ` Sergey Senozhatsky
2020-07-20 18:30         ` Linus Torvalds
2020-07-20 18:30           ` Linus Torvalds
2020-07-21  3:53           ` Joe Perches
2020-07-21  3:53             ` Joe Perches
2020-07-21 14:42           ` Sergey Senozhatsky
2020-07-21 14:42             ` Sergey Senozhatsky
2020-07-21 14:57             ` John Ogness
2020-07-21 14:57               ` John Ogness
2020-07-29  2:03               ` Sergey Senozhatsky
2020-07-29  2:03                 ` Sergey Senozhatsky
2020-07-21 15:40             ` Linus Torvalds
2020-07-21 15:40               ` Linus Torvalds
2020-07-28  2:22               ` Sergey Senozhatsky
2020-07-28  2:22                 ` Sergey Senozhatsky
2020-07-17 23:48 ` [PATCH 3/4] printk: process cont records during reading John Ogness
2020-07-17 23:48   ` John Ogness
2020-07-17 23:48 ` [PATCH 4/4] ipconfig: cleanup printk usage John Ogness
2020-07-17 23:48   ` John Ogness
2020-07-18  0:00 ` [PATCH 0/4] printk: reimplement LOG_CONT handling Linus Torvalds
2020-07-18  0:00   ` Linus Torvalds
2020-07-18 14:42   ` John Ogness
2020-07-18 14:42     ` John Ogness
2020-07-18 17:42     ` Linus Torvalds
2020-07-18 17:42       ` Linus Torvalds
2020-08-11 16:05     ` Petr Mladek
2020-08-11 16:05       ` Petr Mladek
2020-08-12 16:39       ` POC: Alternative solution: " Petr Mladek
2020-08-12 16:39         ` Petr Mladek
2020-08-13  0:24         ` John Ogness
2020-08-13  0:24           ` John Ogness
2020-08-13  5:18           ` Sergey Senozhatsky
2020-08-13  5:18             ` Sergey Senozhatsky
2020-08-13  7:44             ` John Ogness
2020-08-13  7:44               ` John Ogness
2020-08-13  8:41               ` Petr Mladek
2020-08-13  8:41                 ` Petr Mladek
2020-08-13 10:29                 ` John Ogness
2020-08-13 10:29                   ` John Ogness
2020-08-13 11:30                   ` Petr Mladek
2020-08-13 11:30                     ` Petr Mladek
2020-08-14  3:34                   ` Sergey Senozhatsky
2020-08-14  3:34                     ` Sergey Senozhatsky
2020-08-14  8:16                     ` John Ogness
2020-08-14  8:16                       ` John Ogness
2020-08-14  9:12                       ` Petr Mladek
2020-08-14  9:12                         ` Petr Mladek
2020-08-13 11:54                 ` Sergey Senozhatsky
2020-08-13 11:54                   ` Sergey Senozhatsky
2020-08-14  9:04                   ` Petr Mladek
2020-08-14  9:04                     ` Petr Mladek
2020-08-14 22:46                   ` Linus Torvalds
2020-08-14 22:46                     ` Linus Torvalds
2020-08-14 23:52                     ` Joe Perches
2020-08-14 23:52                       ` Joe Perches
2020-08-15  2:33                       ` Linus Torvalds
2020-08-15  2:33                         ` Linus Torvalds
2020-08-15  3:08                         ` Joe Perches
2020-08-15  3:08                           ` Joe Perches
2020-08-15  9:25                       ` David Laight
2020-08-15  9:25                         ` David Laight
2020-08-15  5:41                     ` Sergey Senozhatsky
2020-08-15  5:41                       ` Sergey Senozhatsky
2020-08-13  7:51             ` Petr Mladek
2020-08-13  7:51               ` Petr Mladek
2020-08-13  7:31           ` Petr Mladek
2020-08-13  7:31             ` Petr Mladek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.