Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3276284pxu; Sat, 19 Dec 2020 19:47:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCijO7ZA54LbnF8GMMMRL34vb+8sZzWRrF0zttRF0D+N6Os9MbJdT3WH7lNPmfc3T1anv/ X-Received: by 2002:a50:eb44:: with SMTP id z4mr10800393edp.167.1608436034454; Sat, 19 Dec 2020 19:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608436034; cv=none; d=google.com; s=arc-20160816; b=zTGRsEELlqjg7uKAoDK2G53GYLSPIuzAfM6qEa7BAUlDssnjf9bLktsU2BOHnKcVnI 9wUdCA1haoobCBnh9jQJG0/Yx14TQCOcXYX6e1V75L3CADnCP/Gp2kjRMk75N+m3Cgxi 4XqXlxcUHAR42E2piJSK+dDKzuOMrljudUP4NCsLoZSx3hFHFH+ScG0AdniTNvDMVN9X KEu67E1ylgBXgFrvKzr0Rk/U94R/vUj2TL+B1j4XbD1r0eMx/48rDFTZiUfVF/kxZDwA 1VP0iatzm6dFH1jj1wCSwb1MhqbocE2cIgmAcxIwjOx2XYmaHu+Gu8COBotqjrdvHazf 6GRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dPIWRU8GMV/mioLm3Evvl+n/YmsJ1HcGBUd0zgjOKiU=; b=ai7COPxuNNE0DtpB3jDa6gJjNM8MUtkqqhKrOfzROqMiM2Q33boKC7ncgQcIsNgaWw 6OcTLGe/TwBmtSPwswMyht5QjgfkCK97Ie5rqdQ29IG+WfVFbaYcTjc0rr4Ecpm24x83 4lMkmm+Ncd8biTw7SYlNnRzsRdrjBIGj4Bot7cXp3kNgNGydAbhooaBGuaMrioQQgEY0 7RPcPOmPlu1BpgxGB/Mm+ybtbt2FnL7wnkp48BAMuiSwjJnTqQPP1lSi7F/6kjNfitO7 SweY+RNUGJVpsiqRBxy/l5Jsk+2IwQ0JM9KQVJgyLx19q4SW13wkMm1q5JJFfFYvE4Qn HJTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si6445537eji.269.2020.12.19.19.46.52; Sat, 19 Dec 2020 19:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgLTDqA (ORCPT + 99 others); Sat, 19 Dec 2020 22:46:00 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10051 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbgLTDp5 (ORCPT ); Sat, 19 Dec 2020 22:45:57 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cz7ks2QM6zM6xn; Sun, 20 Dec 2020 11:44:21 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.174) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Sun, 20 Dec 2020 11:45:07 +0800 From: Xiaoming Ni To: , , , , , , , , CC: , Subject: [PATCH v2 2/4] hung_task: Replace "did_panic" with in_panic_state() Date: Sun, 20 Dec 2020 11:45:03 +0800 Message-ID: <20201220034505.113118-3-nixiaoming@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201220034505.113118-1-nixiaoming@huawei.com> References: <20201220034505.113118-1-nixiaoming@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.189.174] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the global variable "did_panic" with in_panic_state() Signed-off-by: Xiaoming Ni --- kernel/hung_task.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index bb2e3e15c84c..2747cd6dd35e 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -50,7 +50,6 @@ unsigned long __read_mostly sysctl_hung_task_check_interval_secs; int __read_mostly sysctl_hung_task_warnings = 10; -static int __read_mostly did_panic; static bool hung_task_show_lock; static bool hung_task_call_panic; static bool hung_task_show_all_bt; @@ -72,18 +71,6 @@ unsigned int __read_mostly sysctl_hung_task_all_cpu_backtrace; unsigned int __read_mostly sysctl_hung_task_panic = CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE; -static int -hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr) -{ - did_panic = 1; - - return NOTIFY_DONE; -} - -static struct notifier_block panic_block = { - .notifier_call = hung_task_panic, -}; - static void check_hung_task(struct task_struct *t, unsigned long timeout) { unsigned long switch_count = t->nvcsw + t->nivcsw; @@ -223,7 +210,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout) * If the system crashed already then all bets are off, * do not report extra hung tasks: */ - if (test_taint(TAINT_DIE) || did_panic) + if (test_taint(TAINT_DIE) || unlikely(in_panic_state())) return; hung_task_show_lock = false; @@ -347,8 +334,6 @@ static int watchdog(void *dummy) static int __init hung_task_init(void) { - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); - /* Disable hung task detector on suspend */ pm_notifier(hungtask_pm_notify, 0); -- 2.27.0