linux/kernel/printk
John Ogness ac7d7844c6 printk: Wait for all reserved records with pr_flush()
Currently pr_flush() will only wait for records that were
available to readers at the time of the call (using
prb_next_seq()). But there may be more records (non-finalized)
that have following finalized records. pr_flush() should wait
for these to print as well. Particularly because any trailing
finalized records may be the messages that the calling context
wants to ensure are printed.

Add a new ringbuffer function prb_next_reserve_seq() to return
the sequence number following the most recently reserved record.
This guarantees that pr_flush() will wait until all current
printk() messages (completed or in progress) have been printed.

Fixes: 3b604ca812 ("printk: add pr_flush()")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240207134103.1357162-10-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
2024-02-07 17:23:18 +01:00
..
braille.c printk: Replace strncmp() with str_has_prefix() 2019-08-16 09:54:08 +02:00
braille.h
console_cmdline.h printk: Fix preferred console selection with multiple matches 2020-02-18 09:34:42 +01:00
index.c kernel/printk/index.c: fix memory leak with using debugfs_lookup() 2023-02-03 10:42:02 +01:00
internal.h printk: Add this_cpu_in_panic() 2024-02-07 17:23:18 +01:00
Makefile printk: Add non-BKL (nbcon) console basic infrastructure 2023-09-18 17:03:45 +02:00
nbcon.c printk: nbcon: Relocate 32bit seq macros 2024-02-07 17:23:17 +01:00
printk.c printk: Wait for all reserved records with pr_flush() 2024-02-07 17:23:18 +01:00
printk_ringbuffer.c printk: Wait for all reserved records with pr_flush() 2024-02-07 17:23:18 +01:00
printk_ringbuffer.h printk: Wait for all reserved records with pr_flush() 2024-02-07 17:23:18 +01:00
printk_safe.c printk: Consolidate console deferred printing 2023-07-20 13:06:22 +02:00
sysctl.c printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() 2022-02-03 11:27:38 -08:00