linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sysfs: add counters for lockups and stalls
@ 2025-05-04 18:08 Max Kellermann
  2025-05-04 18:08 ` [PATCH v2 1/2] kernel/watchdog: add /sys/kernel/{hard,soft}lockup_count Max Kellermann
  2025-05-04 18:08 ` [PATCH v2 2/2] kernel/rcu/tree_stall: add /sys/kernel/rcu_stall_count Max Kellermann
  0 siblings, 2 replies; 6+ messages in thread
From: Max Kellermann @ 2025-05-04 18:08 UTC (permalink / raw)
  To: akpm, song, joel.granados, dianders, cminyard, linux-kernel
  Cc: Max Kellermann

Commits 9db89b411170 ("exit: Expose "oops_count" to sysfs") and
8b05aa263361 ("panic: Expose "warn_count" to sysfs") added counters
for oopses and warnings to sysfs, and these two patches do the same
for hard/soft lockups and RCU stalls.

All of these counters are useful for monitoring tools to detect
whether the machine is healthy.  If the kernel has experienced a
lockup or a stall, it's probably due to a kernel bug, and I'd like to
detect that quickly and easily.  There is currently no way to detect
that, other than parsing dmesg.  Or observing indirect effects: such
as certain tasks not responding, but then I need to observe all tasks,
and it may take a while until these effects become visible/measurable.
I'd rather be able to detect the primary cause more quickly, possibly
before everything falls apart.

Max Kellermann (2):
  kernel/watchdog: add /sys/kernel/{hard,soft}lockup_count
  kernel/rcu/tree_stall: add /sys/kernel/rcu_stall_count

 .../ABI/testing/sysfs-kernel-hardlockup_count |  7 +++
 .../ABI/testing/sysfs-kernel-rcu_stall_count  |  6 +++
 .../ABI/testing/sysfs-kernel-softlockup_count |  7 +++
 kernel/rcu/tree_stall.h                       | 26 +++++++++
 kernel/watchdog.c                             | 53 +++++++++++++++++++
 5 files changed, 99 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-hardlockup_count
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-rcu_stall_count
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-softlockup_count

-- 
2.47.2


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

end of thread, other threads:[~2025-06-04 13:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-04 18:08 [PATCH v2 0/2] sysfs: add counters for lockups and stalls Max Kellermann
2025-05-04 18:08 ` [PATCH v2 1/2] kernel/watchdog: add /sys/kernel/{hard,soft}lockup_count Max Kellermann
2025-05-04 18:08 ` [PATCH v2 2/2] kernel/rcu/tree_stall: add /sys/kernel/rcu_stall_count Max Kellermann
2025-06-03 16:39   ` Sourabh Jain
2025-06-04  0:16     ` Andrew Morton
2025-06-04 13:55       ` Sourabh Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).