public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bitao Hu <yaoma@linux.alibaba.com>
To: dianders@chromium.org, akpm@linux-foundation.org,
	pmladek@suse.com, kernelfans@gmail.com,
	liusong@linux.alibaba.com
Cc: linux-kernel@vger.kernel.org, yaoma@linux.alibaba.com
Subject: [PATCHv5 3/3] watchdog/softlockup: add SOFTLOCKUP_DETECTOR_INTR_STORM Kconfig knob
Date: Tue,  6 Feb 2024 17:59:02 +0800	[thread overview]
Message-ID: <20240206095902.56406-4-yaoma@linux.alibaba.com> (raw)
In-Reply-To: <20240206095902.56406-1-yaoma@linux.alibaba.com>

The interrupt storm detection mechanism we implemented requires a
considerable amount of global storage space when configured for
the maximum number of CPUs.
Therefore, adding a SOFTLOCKUP_DETECTOR_INTR_STORM Kconfig knob that
defaults to "yes" if the max number of CPUs is <= 128.

Signed-off-by: Bitao Hu <yaoma@linux.alibaba.com>
---
 kernel/watchdog.c |  2 +-
 lib/Kconfig.debug | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 26dc1ad86276..1595e4a94774 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -338,7 +338,7 @@ __setup("watchdog_thresh=", watchdog_thresh_setup);
 
 static void __lockup_detector_cleanup(void);
 
-#ifdef CONFIG_IRQ_TIME_ACCOUNTING
+#ifdef CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM
 #define NUM_STATS_GROUPS	5
 #define NUM_STATS_PER_GROUP	4
 enum stats_per_group {
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 975a07f9f1cc..74002ba7c42d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1029,6 +1029,19 @@ config SOFTLOCKUP_DETECTOR
 	  chance to run.  The current stack trace is displayed upon
 	  detection and the system will stay locked up.
 
+config SOFTLOCKUP_DETECTOR_INTR_STORM
+	bool "Detect Interrupt Storm in Soft Lockups"
+	depends on SOFTLOCKUP_DETECTOR && IRQ_TIME_ACCOUNTING
+	default y if NR_CPUS <= 128
+	help
+	  Say Y here to enable the kernel to detect interrupt storm
+	  during "soft lockups".
+
+	  "soft lockups" can be caused by a variety of reasons. If one is caused by
+	  an interrupt storm, then the storming interrupts will not be on the
+	  callstack. To detect this case, it is necessary to report the CPU stats
+	  and the interrupt counts during the "soft lockups".
+
 config BOOTPARAM_SOFTLOCKUP_PANIC
 	bool "Panic (Reboot) On Soft Lockups"
 	depends on SOFTLOCKUP_DETECTOR
-- 
2.37.1 (Apple Git-137.1)


  parent reply	other threads:[~2024-02-06  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06  9:58 [PATCHv5 0/3] *** Detect interrupt storm in softlockup *** Bitao Hu
2024-02-06  9:59 ` [PATCHv5 1/3] watchdog/softlockup: low-overhead detection of interrupt Bitao Hu
2024-02-06 21:41   ` Doug Anderson
2024-02-07  6:18     ` Bitao Hu
2024-02-07 17:13       ` Doug Anderson
2024-02-06  9:59 ` [PATCHv5 2/3] watchdog/softlockup: report the most frequent interrupts Bitao Hu
2024-02-06 21:42   ` Doug Anderson
2024-02-07  6:18     ` Bitao Hu
2024-02-07 17:14       ` Doug Anderson
2024-02-06  9:59 ` Bitao Hu [this message]
2024-02-06 21:42   ` [PATCHv5 3/3] watchdog/softlockup: add SOFTLOCKUP_DETECTOR_INTR_STORM Kconfig knob Doug Anderson
2024-02-07  6:19     ` Bitao Hu

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=20240206095902.56406-4-yaoma@linux.alibaba.com \
    --to=yaoma@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=dianders@chromium.org \
    --cc=kernelfans@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liusong@linux.alibaba.com \
    --cc=pmladek@suse.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