summaryrefslogtreecommitdiff
path: root/kernel/printk/internal.h
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2024-09-04 14:11:27 +0206
committerPetr Mladek <pmladek@suse.com>2024-09-04 15:56:32 +0200
commit5c586baa60e46d9fccd04f04e16f8a50b2fbc1af (patch)
tree75b481dc75d82501907172afb48e1666dac2be97 /kernel/printk/internal.h
parent9b79a3d0d64abae92457cb830baa6c6a717778b0 (diff)
downloadlinux-next-5c586baa60e46d9fccd04f04e16f8a50b2fbc1af.tar.gz
linux-next-5c586baa60e46d9fccd04f04e16f8a50b2fbc1af.zip
printk: nbcon: Use thread callback if in task context for legacy
When printing via console_lock, the write_atomic() callback is used for nbcon consoles. However, if it is known that the current context is a task context, the write_thread() callback can be used instead. Using write_thread() instead of write_atomic() helps to reduce large disabled preemption regions when the device_lock does not disable preemption. This is mainly a preparatory change to allow avoiding write_atomic() completely during normal operation if boot consoles are registered. As a side-effect, it also allows consolidating the printing code for legacy printing and the kthread printer. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20240904120536.115780-9-john.ogness@linutronix.de Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/printk/internal.h')
-rw-r--r--kernel/printk/internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h
index 14f7fc71e20d..a96d4114a1db 100644
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
@@ -90,7 +90,7 @@ void nbcon_free(struct console *con);
enum nbcon_prio nbcon_get_default_prio(void);
void nbcon_atomic_flush_pending(void);
bool nbcon_legacy_emit_next_record(struct console *con, bool *handover,
- int cookie);
+ int cookie, bool use_atomic);
bool nbcon_kthread_create(struct console *con);
void nbcon_kthread_stop(struct console *con);
void nbcon_kthreads_wake(void);
@@ -174,7 +174,7 @@ static inline void nbcon_free(struct console *con) { }
static inline enum nbcon_prio nbcon_get_default_prio(void) { return NBCON_PRIO_NONE; }
static inline void nbcon_atomic_flush_pending(void) { }
static inline bool nbcon_legacy_emit_next_record(struct console *con, bool *handover,
- int cookie) { return false; }
+ int cookie, bool use_atomic) { return false; }
static inline void nbcon_kthread_wake(struct console *con) { }
static inline bool console_is_usable(struct console *con, short flags,