[PATCH 2/2] pstore: Bypass loglevel suppression for pstore console

From: Tzung-Bi Shih

Date: Mon Aug 31 2026 - 03:04:43 EST


The pstore console largely serves to continuously dump kernel messages
to persistent backends (e.g., ramoops). Currently, it inherits the
global `console_loglevel` constraints. Relevant verbose logs could be
omitted from a crash dump if the system uses a strict log level to
prevent spam and bottlenecks.

Unlike physical consoles, writing records to RAM (ramoops) is extremely
fast. Applying loglevel limits to pstore provides no system performance
benefit, but sometimes costs engineers the crucial verbose debugging
context leading up to a kernel panic or lockup.

Introduce `PSTORE_FLAGS_CONSOLE_BYPASS_LOGLEVEL` to allow fast pstore
backends to capture full and unsuppressed logs directly regardless of
the system's global loglevel setting. Opt-in for `ramoops`.

Signed-off-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>
---
fs/pstore/platform.c | 4 ++++
fs/pstore/ram.c | 3 ++-
include/linux/pstore.h | 2 ++
3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 1d76c9d92056..88b894163b25 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -421,6 +421,10 @@ static void pstore_register_console(void)
* calls may have changed settings (specifically CON_ENABLED).
*/
pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME;
+
+ if (psinfo->flags & PSTORE_FLAGS_CONSOLE_BYPASS_LOGLEVEL)
+ pstore_console.flags |= CON_BYPASS_LOGLEVEL;
+
register_console(&pstore_console);
}

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 2eb0d4fa2186..945dd55be97a 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -825,7 +825,8 @@ static int ramoops_probe(struct platform_device *pdev)
cxt->pstore.max_reason = pdata->max_reason;
}
if (cxt->console_size)
- cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE;
+ cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE |
+ PSTORE_FLAGS_CONSOLE_BYPASS_LOGLEVEL;
if (cxt->max_ftrace_cnt)
cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
if (cxt->pmsg_size)
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index fed601053c51..34b4acfa21ce 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -206,6 +206,8 @@ struct pstore_info {
#define PSTORE_FLAGS_CONSOLE BIT(1)
#define PSTORE_FLAGS_FTRACE BIT(2)
#define PSTORE_FLAGS_PMSG BIT(3)
+/* Bypass loglevel for fast consoles */
+#define PSTORE_FLAGS_CONSOLE_BYPASS_LOGLEVEL BIT(4)

extern int pstore_register(struct pstore_info *);
extern void pstore_unregister(struct pstore_info *);
--
2.55.0.897.gb25b4bd76c-goog