From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Kees Cook <kees@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Petr Mladek <pmladek@suse.com>
Cc: Tony Luck <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
tzungbi@kernel.org, tfiga@chromium.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] pstore: Bypass loglevel suppression for pstore console
Date: Mon, 31 Aug 2026 07:03:46 +0000 [thread overview]
Message-ID: <20260831070346.3490745-3-tzungbi@kernel.org> (raw)
In-Reply-To: <20260831070346.3490745-1-tzungbi@kernel.org>
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@kernel.org>
---
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
prev parent reply other threads:[~2026-08-31 7:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 7:03 [PATCH 0/2] printk: Introduce loglevel bypass " Tzung-Bi Shih
2026-08-31 7:03 ` [PATCH 1/2] printk: Introduce CON_BYPASS_LOGLEVEL flag Tzung-Bi Shih
2026-08-31 7:03 ` Tzung-Bi Shih [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831070346.3490745-3-tzungbi@kernel.org \
--to=tzungbi@kernel.org \
--cc=gpiccoli@igalia.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tfiga@chromium.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®