Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1916260rdb; Sun, 4 Feb 2024 06:53:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeoNHYieAgM8wWm2osvxfmzFQju+bMi0FwnFp3FUtJYkYLnxzb63GGO8YAZQoVBZ5ZICoH X-Received: by 2002:a05:6512:2026:b0:511:3191:f317 with SMTP id s6-20020a056512202600b005113191f317mr5608651lfs.1.1707058402721; Sun, 04 Feb 2024 06:53:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707058402; cv=pass; d=google.com; s=arc-20160816; b=Ljt9tbu8I7uNlFFw3eN2G5kuWYM712GUEirJmy+TjuzzpPm8YYAi4DRnIJJ/PyI/et CVJ5LXbSu5uoh9cAFL2FDSm3vASqCb6P2H3bdg4pSNuHg/2SE43zogO2/s2Jh66O5E48 A32CfHP11NDml+YLw/iMkJ5lgDJ9iKNiw/ohV7W8IgsdI1Ok+1dxlxdyehQqvrlzHZrc qGfB37+oXEiDTR2gnaRPkjKJcC0OAqdz/SI9boniCmNHdW67iRTOdydfpbPYH13VBr4M N41hVLGQIZoBQjd7KU+lFwTzsa9bCRJfwk6EHomMpQhdPi86TPiYSGYsoWKAhcFHY/Ml vcHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1aIE2l+wx3ThQkg4ZY8lGbbMkz4SlO/OXHAps4v7kP4=; fh=aIfzv7pySZlyvFDbNmQYqLGztxe2CBwtvMAq3BET6ZE=; b=Dj542C4cnh3fiWg/JDo0EK7tpQe6ZoK1LaeJ19TsvtEMvrVFw4SRM3/Jkz7S3Upn0e 91PSMe9xrMU+kvakR64YWUXlHJFQxgeTgU5gv+hgt19OjdIdHKG3iZrc4ZGcRCXf1EtU D0vxIKQZt4ILMghkAsyEH3p9GGPMK0bDQBIrWB6Vm37BIam19EKWiooT4JMZwRQLhZPm 9jiaa5i92H+Wk3X9MZwOSCsaFjPeXZlVo8dVb7I+71eEwJVfWcqL0xEaAOww5MtKDOj/ TtKrpGIa4yCNZmMVeQY5pE3AkvKN7z5JP2RjD2Ou+nivPX6VdB3kdbnxv54PTU+R8j+u gH9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=oPEUsN4s; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-51735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51735-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com X-Forwarded-Encrypted: i=1; AJvYcCVnPh0HMjHQv2Uh/T2gl65jwBMsgv3sBhIQOYnjadbLAblDr0HLl4O0oPp/bSCTUymg+9QBSWlU/uh0i14O+FPPFic0RGKG2O6dGEBq9Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o24-20020a17090611d800b00a3612401eb6si3043565eja.880.2024.02.04.06.53.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 06:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=oPEUsN4s; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-51735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51735-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 67F1E1F218E9 for ; Sun, 4 Feb 2024 14:53:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F727249EE; Sun, 4 Feb 2024 14:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="oPEUsN4s" Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABC582263E for ; Sun, 4 Feb 2024 14:52:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.113 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707058335; cv=none; b=CfyoSEZyiW5I+M9WpmkfAQ1lfCp1YZkCoYGc22MHFJ0PyTpTNJ+Mp4dZsxFbBFZE9X7iWh+9/n0tKkCQ9BKo2xww0WSXoNu+jtMrN6A8lB+wcI2FA+4aGBqsb/tk1ar8ML9MpmA6NEZ70ZTm8gYwfugi3x2zHxmkhXkvpFwynTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707058335; c=relaxed/simple; bh=7Law9ljRW3QDm/qpuBOMmG+RDf0WSd4kRpeuwMpabF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tb1EegmXYam3iLRl1x1haKOMd8Xqn5OZLsGWU4CzNFdfCQWLgGbyerA4xxSZs0ZG3rwa5rKYfiHnUOEZVTHFunRMB8lu6JOAMbnj5KrzE9UDzOgBmVINPzt4VNPw6L2lOoNPk9PMsgNPIP2XiqfVzBS1jBkoCxtc+Aqk/U2DMvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=oPEUsN4s; arc=none smtp.client-ip=115.124.30.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1707058326; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=1aIE2l+wx3ThQkg4ZY8lGbbMkz4SlO/OXHAps4v7kP4=; b=oPEUsN4srA5CQWQd315Ixz5iZVulFIZ8b7PzMPHblmH7wJxtvl3wcFTcxwduAd1TTEj9FSnS/Lr4fZmmH9sSLatdQvIYSRVVlvA/URIZi8E7el3P7yDrH57b+EF42B1uzHRqC7r3QxnFrQu+jA092k9hWGoybRd8awQcD97lf0Q= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R251e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=yaoma@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0W00xP-z_1707058323; Received: from localhost.localdomain(mailfrom:yaoma@linux.alibaba.com fp:SMTPD_---0W00xP-z_1707058323) by smtp.aliyun-inc.com; Sun, 04 Feb 2024 22:52:06 +0800 From: Bitao Hu 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: [PATCHv4 3/3] watchdog/softlockup: add SOFTLOCKUP_DETECTOR_INTR_STORM Kconfig knob Date: Sun, 4 Feb 2024 22:51:54 +0800 Message-Id: <20240204145154.11069-4-yaoma@linux.alibaba.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20240204145154.11069-1-yaoma@linux.alibaba.com> References: <20240204145154.11069-1-yaoma@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 d31120c3e9d1..a2722935a381 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 enum stats_per_group { STATS_SYSTEM, 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)