Skip to content

wire up nbcon atomic printing

John Ogness kexec lkml rcu 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest11 patches 30 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11printk: Make console_is_usable() available to nbconkernel/printk/internal.h kernel/printk/printk.c+32 -301 reply
2/11printk: Let console_is_usable() handle nbconkernel/printk/internal.h+9 -21 reply
3/11printk: Add @flags argument for console_is_usable()kernel/printk/internal.h kernel/printk/printk.c+5 -81 reply
4/11printk: nbcon: Provide functions to mark atomic write sectionsinclude/linux/console.h kernel/printk/nbcon.c+93 -012 replies
5/11printk: nbcon: Provide function for atomic flushinginclude/linux/printk.h kernel/printk/nbcon.c+105 -22 replies
6/11printk: nbcon: Wire up nbcon console atomic flushingkernel/printk/nbcon.c kernel/printk/printk.c+16 -04 replies
7/11printk: nbcon: Wire up nbcon into console_flush_all()kernel/printk/internal.h kernel/printk/nbcon.c kernel/printk/printk.c+65 -91 reply
8/11panic: Add atomic write enforcement to warn/panickernel/panic.c+17 -01 reply
9/11panic: Add atomic write enforcement to oopskernel/panic.c+49 -05 replies
10/11rcu: Add atomic write enforcement for rcu stallskernel/rcu/tree_stall.h+6 -01 reply
11/11lockdep: Add atomic write enforcement for lockdep splatskernel/locking/lockdep.c+7 -01 reply

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by.

PatchPetr Mladek
1/11R-b
2/11R-b
3/11R-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH printk v2 00/11] wire up nbcon atomic printing

Hi,

This is v2 of a series to wire up the nbcon consoles so that they actually perform atomic printing. This series is only a subset of the original v1 [0]. In particular, this series represents patches 14 and 16-18 of the v1 series. For information about the motivation of the atomic consoles, please read the cover letter of v1.

This series focuses on providing the functionality and marking of atomic printing sections as well as wiring up the nbcon atomic printing to the general console_flush_all() function. This series does _not_ include threaded printing or nbcon drivers. Those features will be added in separate follow-up series.

Note that the behavior of atomic printing in priority-elevated atomic printing sections differs from the legacy consoles. With atomic printing, the full set of urgent messages (WARN/OOPS/PANIC) are first stored into the ringbuffer and then afterwards flushed. This makes sure the full backtraces are available in the ringbuffer, even if they do not make it out to the console(s). This is in accordance with what was discussed at LPC 2022 [1].

A lot has changed since v1 and the patches no longer correlate 1:1. Here is an attempt to list the changes:

- Rather than flushing the full ringbuffer with one nbcon console before moving to the next nbcon console, adapt the same flushing strategy as the legacy consoles: rotation through the consoles, one record at a time.

- Introduce nbcon_atomic_emit_one() to perform the "lock, emit one record, unlock" pattern. (This is only a helper function.)

- Introduce nbcon_console_emit_next_record() to act as the nbcon variant of console_emit_next_record(). This allows straight forward integration of nbcon consoles into console_flush_all().

- nbcon_atomic_flush() no longer takes any arguments. These were awkward for the caller. The context object is now hidden from the caller.

- Introduce __nbcon_atomic_flush_all() as an internal helper function in order to hide the ability to attempt unsafe hostile takeovers from outside nbcon.c.

- For printk_trigger_flush(), migration is disabled instead of preemption.

- Add atomic write enforcement to oops and lockdep.

- Comments and kerneldoc updated.

John Ogness

[0] https://lore.kernel.org/lkml/[email protected]

[1] https://lore.kernel.org/lkml/[email protected]

John Ogness (7):
printk: Make console_is_usable() available to nbcon
printk: Let console_is_usable() handle nbcon
printk: Add @flags argument for console_is_usable()
printk: nbcon: Wire up nbcon into console_flush_all()
panic: Add atomic write enforcement to oops
rcu: Add atomic write enforcement for rcu stalls
lockdep: Add atomic write enforcement for lockdep splats

Thomas Gleixner (4):
printk: nbcon: Provide functions to mark atomic write sections
printk: nbcon: Provide function for atomic flushing
printk: nbcon: Wire up nbcon console atomic flushing
panic: Add atomic write enforcement to warn/panic

 include/linux/console.h  |   4 +
 include/linux/printk.h   |   6 +
 kernel/locking/lockdep.c |   7 ++
 kernel/panic.c           |  66 +++++++++++
 kernel/printk/internal.h |  37 ++++++
 kernel/printk/nbcon.c    | 246 ++++++++++++++++++++++++++++++++++++++-
 kernel/printk/printk.c   |  67 +++++------
 kernel/rcu/tree_stall.h  |   6 +
 8 files changed, 396 insertions(+), 43 deletions(-)

base-commit: 9757acd0a700ba4a0d16dde4ba820eb052aba1a7

Signature · 1 line
2.39.2