* [to-be-updated] sys_info-add-helper-for-callers-that-print-some-sys_info-on-their-own.patch removed from -mm tree
@ 2026-06-26 16:50 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-06-26 16:50 UTC (permalink / raw)
To: mm-commits, stable, pmladek, npiggin, mpe, maddy, dianders,
include, akpm
The quilt patch titled
Subject: sys_info: add helper for callers that print some sys_info on their own
has been removed from the -mm tree. Its filename was
sys_info-add-helper-for-callers-that-print-some-sys_info-on-their-own.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: Bradley Morgan <include@grrlz.net>
Subject: sys_info: add helper for callers that print some sys_info on their own
Date: Thu, 25 Jun 2026 15:25:55 +0000
Patch series "sys_info: prevent duplicate backtraces", v3.
Some callers handle SYS_INFO_ALL_BT themselves before calling sys_info().
When they strip that bit, an all_bt-only mask becomes zero and sys_info(0)
falls back to kernel_si_mask, potentially duplicating output.
This series adds sys_info_with_filter() to filter specific bits without
triggering the kernel_si_mask fallback.
This patch (of 4):
Some callers print some sys_info on their own before calling sys_info().
Add a helper which would allow to prevent a duplicated output.
It is a bit tricky because kernel_si_mask should be used only when the
call-specific si_mask is empty. But the duplicated output must be
prevented there as well.
Link: https://lore.kernel.org/20260625152558.7450-1-include@grrlz.net
Link: https://lore.kernel.org/20260625152558.7450-2-include@grrlz.net
Fixes: a9af76a78760 ("watchdog: add sys_info sysctls to dump sys info on system lockup")
Signed-off-by: Bradley Morgan <include@grrlz.net>
Suggested-by: Petr Mladek <pmladek@suse.com>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/sys_info.h | 1 +
lib/sys_info.c | 20 ++++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
--- a/include/linux/sys_info.h~sys_info-add-helper-for-callers-that-print-some-sys_info-on-their-own
+++ a/include/linux/sys_info.h
@@ -18,6 +18,7 @@
#define SYS_INFO_BLOCKED_TASKS 0x00000080
void sys_info(unsigned long si_mask);
+void sys_info_with_filter(unsigned long si_mask, unsigned long si_ignore_mask);
unsigned long sys_info_parse_param(char *str);
#ifdef CONFIG_SYSCTL
--- a/lib/sys_info.c~sys_info-add-helper-for-callers-that-print-some-sys_info-on-their-own
+++ a/lib/sys_info.c
@@ -136,8 +136,10 @@ static int __init sys_info_sysctl_init(v
subsys_initcall(sys_info_sysctl_init);
#endif
-static void __sys_info(unsigned long si_mask)
+static void __sys_info(unsigned long si_mask, unsigned long si_ignore_mask)
{
+ si_mask &= ~si_ignore_mask;
+
if (si_mask & SYS_INFO_TASKS)
show_state();
@@ -160,7 +162,21 @@ static void __sys_info(unsigned long si_
show_state_filter(TASK_UNINTERRUPTIBLE);
}
+void sys_info_with_filter(unsigned long si_mask, unsigned long si_ignore_mask)
+{
+ unsigned long dump_mask = si_mask & ~si_ignore_mask;
+
+ /*
+ * Do not fall back to kernel_si_mask when the caller context
+ * required only the ignored information.
+ */
+ if (si_mask && !dump_mask)
+ return;
+
+ __sys_info(dump_mask ? : kernel_si_mask, si_ignore_mask);
+}
+
void sys_info(unsigned long si_mask)
{
- __sys_info(si_mask ? : kernel_si_mask);
+ sys_info_with_filter(si_mask, 0);
}
_
Patches currently in -mm which might be from include@grrlz.net are
watchdog-use-sys_info_with_filter-to-avoid-duplicate-backtraces.patch
powerpc-watchdog-use-sys_info_with_filter-to-avoid-duplicate-backtraces.patch
panic-use-sys_info_with_filter-to-avoid-duplicate-backtraces.patch
lib-string-fix-memchr_inv-for-large-ranges.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-26 16:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 16:50 [to-be-updated] sys_info-add-helper-for-callers-that-print-some-sys_info-on-their-own.patch removed from -mm tree Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox