Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH printk 0/3] Introduce sync mode
@ 2026-07-10 14:45 John Ogness
  2026-07-10 14:45 ` [PATCH printk 2/3] proc: Add console sync support for /proc/consoles John Ogness
  2026-07-10 21:05 ` [PATCH printk 0/3] Introduce sync mode John Ogness
  0 siblings, 2 replies; 3+ messages in thread
From: John Ogness @ 2026-07-10 14:45 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Andrew Murray, Chris Down,
	linux-kernel, Greg Kroah-Hartman, linux-fsdevel, Jonathan Corbet,
	Shuah Khan, linux-doc

Hi,

As proposed in an LKML thread [0], here is a series to introduce a
new console feature to use synchronous printing. The feature is
activated using the keyword "sync" in the console= command line
argument. For example:

   console=ttyS0,115200,sync

Sync mode is only available for nbcon consoles that provide a
safe write_atomic() callback. Specifying it for other consoles
will have no effect other than a log entry that sync mode is not
supported.

Patch 3/3 shamelessly copied an implementation from Chris Down
to parse and update the console options. (Chris's version of 
find_and_remove_console_option() is here [1]). I slightly extended
the function to support valueless-options.

At some point we may want to add a sysfs interface to toggle sync
mode.

John Ogness

[0] https://lore.kernel.org/lkml/87v7aruub1.fsf@jogness.linutronix.de
[1] https://lore.kernel.org/lkml/77aa59337507e067f3a4ad7e15375893612bcfa3.1763492585.git.chris@chrisdown.name

John Ogness (3):
  printk: Introduce console sync mode
  proc: Add console sync support for /proc/consoles
  printk: Support setting console sync mode via console=

 Documentation/admin-guide/serial-console.rst |   8 ++
 fs/proc/consoles.c                           |   1 +
 include/linux/console.h                      |   2 +
 kernel/printk/console_cmdline.h              |   1 +
 kernel/printk/internal.h                     |   2 +
 kernel/printk/nbcon.c                        |  42 ++++++--
 kernel/printk/printk.c                       | 104 +++++++++++++++++++
 7 files changed, 154 insertions(+), 6 deletions(-)


base-commit: 080d60fffa8e0d285871cde8395438006a9b5b0c
-- 
2.47.3


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

* [PATCH printk 2/3] proc: Add console sync support for /proc/consoles
  2026-07-10 14:45 [PATCH printk 0/3] Introduce sync mode John Ogness
@ 2026-07-10 14:45 ` John Ogness
  2026-07-10 21:05 ` [PATCH printk 0/3] Introduce sync mode John Ogness
  1 sibling, 0 replies; 3+ messages in thread
From: John Ogness @ 2026-07-10 14:45 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Andrew Murray, Chris Down,
	linux-kernel, linux-fsdevel

Update /proc/consoles output to show 's' if a console is
running in sync mode.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 fs/proc/consoles.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c
index b7cab1ad990da..f9af07d161412 100644
--- a/fs/proc/consoles.c
+++ b/fs/proc/consoles.c
@@ -25,6 +25,7 @@ static int show_console_dev(struct seq_file *m, void *v)
 		{ CON_PRINTBUFFER,	'p' },
 		{ CON_BRL,		'b' },
 		{ CON_ANYTIME,		'a' },
+		{ CON_SYNC,		's' },
 	};
 	char flags[ARRAY_SIZE(con_flags) + 1];
 	struct console *con = v;
-- 
2.47.3


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

* Re: [PATCH printk 0/3] Introduce sync mode
  2026-07-10 14:45 [PATCH printk 0/3] Introduce sync mode John Ogness
  2026-07-10 14:45 ` [PATCH printk 2/3] proc: Add console sync support for /proc/consoles John Ogness
@ 2026-07-10 21:05 ` John Ogness
  1 sibling, 0 replies; 3+ messages in thread
From: John Ogness @ 2026-07-10 21:05 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Andrew Murray, Chris Down,
	linux-kernel, Greg Kroah-Hartman, linux-fsdevel, Jonathan Corbet,
	Shuah Khan, linux-doc

On 2026-07-10, John Ogness <john.ogness@linutronix.de> wrote:
> As proposed in an LKML thread [0], here is a series to introduce a
> new console feature to use synchronous printing.

So the Sashiko review [0] found all kinds of issues and every one of
them are legitimate. In particular, I totally forgot about:

- the console_lock synchronization when boot consoles exist

- the various sites that _rely_ on kthreads printing when
  printk_get_console_flush_type() reports ft.nbcon_offload

I will consider each of the points mentioned by Sashiko and include my
proposed solution in my response. I will need a few days to go through
all of it.

John

[0] https://sashiko.dev/#/patchset/20260710144609.194487-1-john.ogness%40linutronix.de


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

end of thread, other threads:[~2026-07-10 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 14:45 [PATCH printk 0/3] Introduce sync mode John Ogness
2026-07-10 14:45 ` [PATCH printk 2/3] proc: Add console sync support for /proc/consoles John Ogness
2026-07-10 21:05 ` [PATCH printk 0/3] Introduce sync mode John Ogness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox