LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] sys_info: add helper for callers that handle all_bt
@ 2026-06-23 15:34 Bradley Morgan
  2026-06-23 15:34 ` [PATCH v2 2/4] watchdog: avoid sys_info fallback for all_bt Bradley Morgan
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Bradley Morgan @ 2026-06-23 15:34 UTC (permalink / raw)
  To: Petr Mladek, Feng Tang, Andrew Morton
  Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Mukesh Kumar Chaurasiya, Andy Shevchenko,
	Jinchao Wang, Kees Cook, Rio, Joel Granados, Pnina Feder,
	Petr Pavlu, Sergey Senozhatsky, Douglas Anderson, Mayank Rungta,
	Tejun Heo, Zhenguo Yao, linuxppc-dev, linux-kernel, stable,
	Bradley Morgan

Some callers handle SYS_INFO_ALL_BT themselves before calling sys_info().
Add a helper that strips that bit without turning an all_bt only mask into
a kernel_sys_info fallback.

Signed-off-by: Bradley Morgan <include@grrlz.net>
---
Changes since v1:
- New patch for the shared helper suggested by Petr.

 include/linux/sys_info.h |  1 +
 lib/sys_info.c           | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/linux/sys_info.h b/include/linux/sys_info.h
index a5bc3ea3d44b..87a841ec7b6a 100644
--- a/include/linux/sys_info.h
+++ b/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_without_all_bt(unsigned long si_mask);
 unsigned long sys_info_parse_param(char *str);
 
 #ifdef CONFIG_SYSCTL
diff --git a/lib/sys_info.c b/lib/sys_info.c
index f32a06ec9ed4..6afd4c697633 100644
--- a/lib/sys_info.c
+++ b/lib/sys_info.c
@@ -164,3 +164,18 @@ void sys_info(unsigned long si_mask)
 {
 	__sys_info(si_mask ? : kernel_si_mask);
 }
+
+void sys_info_without_all_bt(unsigned long si_mask)
+{
+	unsigned long dump_mask = si_mask & ~SYS_INFO_ALL_BT;
+
+	/*
+	 * Do not call sys_info() when the caller context required only
+	 * backtraces from all CPUs. Otherwise sys_info() would fall back
+	 * to the generic kernel_si_mask.
+	 */
+	if (si_mask && !dump_mask)
+		return;
+
+	sys_info(dump_mask);
+}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-06-24  2:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 15:34 [PATCH v2 1/4] sys_info: add helper for callers that handle all_bt Bradley Morgan
2026-06-23 15:34 ` [PATCH v2 2/4] watchdog: avoid sys_info fallback for all_bt Bradley Morgan
2026-06-23 15:35 ` [PATCH v2 3/4] powerpc/watchdog: " Bradley Morgan
2026-06-23 15:35 ` [PATCH v2 4/4] panic: avoid duplicate all CPU backtraces from sys_info Bradley Morgan
2026-06-24  2:50   ` Feng Tang
2026-06-23 20:11 ` [PATCH v2 1/4] sys_info: add helper for callers that handle all_bt Andy Shevchenko
2026-06-23 20:14   ` Andy Shevchenko
2026-06-23 20:16     ` Bradley Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox