[PATCH printk v4 0/8] provide nbcon base

From: John Ogness
Date: Fri Sep 08 2023 - 14:52:03 EST


Hi,

This is v4 of a series to introduce the new non-BKL (nbcon)
consoles. v3 is here [0]. For information about the motivation
of the atomic consoles, please read the cover letter of v1 [1].

This series focuses on providing the base functionality of the
nbcon consoles. In particular, it implements the ownership and
priority semantics for nbcon consoles. This series does _not_
include threaded printing, atomic printing regions, or nbcon
drivers. Those features will be added in separate follow-up
series.

The changes since v3:

- Remove @req_tag from nbcon_state. Comments in
nbcon_waiter_matches() updated to explain why @req_prio is
enough.

- Rename nbcon_cleanup() to nbcon_free().

- In nbcon_seq_try_update(), expand sequence when cmpxchg
fails.

- Add macros nbcon_context_enter_unsafe() and
nbcon_context_exit_unsafe() to replace
nbcon_context_update_unsafe() usage.

- Rename nbcon_context_update_unsafe() to
__nbcon_context_update_unsafe() since it should not be called
directly. Use the new macros instead.

- Put printk_get_next_message() and console_prepend_dropped()
within an unsafe region to avoid NORMAL and EMERGENCY
priorities clobbering buffers.

- Make the global legacy @pbufs (from
within console_emit_next_record()) available to nbcon.c as
well, renaming it to @printk_shared_pbufs.

- For nbcon boot consoles, use @printk_shared_pbufs as its
printk buffers. This works because boot console printing will
be synchronized on the console_lock.

- Fix kerneldoc for nbcon_context_acquire_hostile().

- Update comments as suggested by pmladek.

John Ogness

[0] https://lore.kernel.org/lkml/20230903150539.245076-1-john.ogness@xxxxxxxxxxxxx

[1] https://lore.kernel.org/lkml/20230302195618.156940-6-john.ogness@xxxxxxxxxxxxx

John Ogness (1):
printk: Make static printk buffers available to nbcon

Thomas Gleixner (7):
printk: Add non-BKL (nbcon) console basic infrastructure
printk: nbcon: Add acquire/release logic
printk: nbcon: Add buffer management
printk: nbcon: Add ownership state functions
printk: nbcon: Add sequence handling
printk: nbcon: Add emit function and callback function for atomic
printing
printk: nbcon: Allow drivers to mark unsafe regions and check state

include/linux/console.h | 132 ++++++
kernel/printk/Makefile | 2 +-
kernel/printk/internal.h | 31 ++
kernel/printk/nbcon.c | 948 +++++++++++++++++++++++++++++++++++++++
kernel/printk/printk.c | 73 ++-
5 files changed, 1163 insertions(+), 23 deletions(-)
create mode 100644 kernel/printk/nbcon.c


base-commit: cb65d08d735e00cc55ad7700a82a453bb88c93a3
--
2.39.2