From patchwork Sun Feb 4 14:51:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bitao Hu X-Patchwork-Id: 196519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp387718dyb; Sun, 4 Feb 2024 06:53:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJMaM6kaxk4bmOvNnm9bb7tRObw9C2FtL01S8NoOax6MGN6oAFImj5FG/1jGlalN50NBTK X-Received: by 2002:a05:6808:238c:b0:3bf:cd78:6776 with SMTP id bp12-20020a056808238c00b003bfcd786776mr6052755oib.22.1707058422518; Sun, 04 Feb 2024 06:53:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707058422; cv=pass; d=google.com; s=arc-20160816; b=TeFLjo38sgt74NbMaYuJ9091HfO9EDzZOCBeI2Tj8QpPpVz+g5hrwtQAb0OaClcuXN PMcCDSR6UyMkYQTzO1MokO317yd6c5c0cGfmhcSFjS5iR3b3UYMFX4WmWB3DJEcpya9y kCjD48zMMKf4N1MtX9MSxWRwBhDREyOQckT2RWGFfHECQUEc5h7/B7ef/CtVUZBA9ULs syWDNNOHWqVPx9iD0BfEYs8BcwhG+f23YasIvW3Tg1j9HWdnR55l3580MdidAj2yolJp U0lN/EZenYRbIoCVqGtLVjaG3pz4XHexiJC8NqDjiIY8GqK0T4M6n3Bt2QlfAgAwwRHM iV8g== 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=NL5wNBw25ifgpT6hp2WtGjxTaSGJlIdtmS2ipY0Bz9Y=; b=FQRw3//YzqKMrIEJ5XTbritMR7NYdQ/CoFPPN30/JtLepBVqQGRhzQvWE1Pc/Cq679 /1iXwDQE16Arpc3m69PEoSDnlMkJXDQ8riCAoGQNanSowSNw4GBSDKm2DvTtfSC2uznP EZp7AuVabkYd9PwY4kSa4pKx2fbQpkxsfxL2MAVeCIq5dHrAu08BrcE8jTtXkFGMVPX6 J7AWgUMxF6+Ac7jPXZqsG1pm9pupwnwjSSIRvkXSYp04xwybAGnDeeNnJvqOjQgqqMu+ dEr5i9c0vFO5NphDbBoRPsveKoIZEx5Cj4xUNnu1W+Oz04AsP4quY6UrgtHzNj04aFnK e5xw==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51735-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com X-Forwarded-Encrypted: i=1; AJvYcCWWYud6kU74Jw1/d5PlV1aeOHZR7pHmV6d+Oc1dALxRt3auvUecxzwYUpJzHV082mfaZ2XiBGNKbvBN8UKfX//rjTPb/A== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u12-20020a056a00098c00b006dde04fa61fsi4712526pfg.48.2024.02.04.06.53.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 06:53:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51735-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51735-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E4910B220F4 for ; Sun, 4 Feb 2024 14:53:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79AD324A1D; Sun, 4 Feb 2024 14:52:18 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789980492293469630 X-GMAIL-MSGID: 1789980492293469630 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