diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2024-08-20 08:35:57 +0206 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2024-08-21 15:03:04 +0200 |
| commit | ecb5e1aa82c86642ec1eaafefd4e317dfba3a238 (patch) | |
| tree | 11696502a9e1e73e338cf81d25989099d9f31f91 /kernel/printk/internal.h | |
| parent | 6690d6b52726bcb2b743466a1833e0b9f049b9d7 (diff) | |
printk: nbcon: Implement emergency sections
In emergency situations (something has gone wrong but the
system continues to operate), usually important information
(such as a backtrace) is generated via printk(). This
information should be pushed out to the consoles ASAP.
Add per-CPU emergency nesting tracking because an emergency
can arise while in an emergency situation.
Add functions to mark the beginning and end of emergency
sections where the urgent messages are generated.
Perform direct console flushing at the emergency priority if
the current CPU is in an emergency state and it is safe to do
so.
Note that the emergency state is not system-wide. While one CPU
is in an emergency state, another CPU may attempt to print
console messages at normal priority.
Also note that printk() already attempts to flush consoles in
the caller context for normal priority. However, follow-up
changes will introduce printing kthreads, in which case the
normal priority printk() calls will offload to the kthreads.
Co-developed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Thomas Gleixner (Intel) <tglx@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240820063001.36405-32-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.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h index ba2e0f1940bd..8e36d8695f81 100644 --- a/kernel/printk/internal.h +++ b/kernel/printk/internal.h @@ -182,6 +182,7 @@ static inline void printk_get_console_flush_type(struct console_flush_type *ft) switch (nbcon_get_default_prio()) { case NBCON_PRIO_NORMAL: + case NBCON_PRIO_EMERGENCY: if (have_nbcon_console && !have_boot_console) ft->nbcon_atomic = true; |
