Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1207502rwb; Sat, 5 Aug 2023 09:21:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN+kTMSCvsDWeWImMdQUcwpFB9cCFPumkmyB4qvj7vaGn/6Vvf0ejG5JnNWgfQAfyNwbR3 X-Received: by 2002:a17:902:f7d1:b0:1bb:98a0:b78a with SMTP id h17-20020a170902f7d100b001bb98a0b78amr4328204plw.18.1691252474985; Sat, 05 Aug 2023 09:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691252474; cv=none; d=google.com; s=arc-20160816; b=ga7+SOhgS1NFpLpRanIvYbhkC4eKRqlNCZaRy0YBBizJnvoRbzkCbKlN/knrf6q31r uJ6OI1Iuz4qk8K643D0QAb4lkP3EDzVf/91wVbp1fh46oeb3eNFcRoBJRfkvpCWJ8Hli I886KUJ0XHUJgO0ykp5rt0OjXMmfk8t6WWplhU0rsF02qpUFmbn/fLW3kBIUsP0XT+WA jwSrOWBAARlBQJdfUXPa9CzSEzG8IjTYkVrJbt7KSaaoci/Z3PWSeWQBgIW0WEppFKg0 4TOgVsCZlwkaVn/ClEah+gDW18SpcAq5laOMiT1muYBIJDgefqgvNebZOjUZ+w3/M8I1 V7hQ== 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 :message-id:date:subject:cc:to:from; bh=rSCPodaCP+FO9qwl0DmFHLvKbHxW+XJffje+ui86vtE=; fh=eHIL6y4bx9oMi0kwpAHIbab9W1ErB/O+ENO7hB/RGjI=; b=qS/SSz0q70q0hLTfa/31V7aXGh5n7p14SygvY6D+eqBN3OHOwOUzDNepT6LG/i3tV9 /SMxtmYNKrr3vN5gB/i5MRyQxfl6MJSfRVBfYBwU1e0GKOP80Tm2xRs1tYjLOQ5znzlu zwrjQldJUTh2aukokaM67oH933HkoVyCRSCicl+maIdMv6doJxpgxWYIkxixd24OVy1u 8nolwsa+hXMox0SgGFePlDAW9FpktzwGrsP0IVLVF4+SaEsffA9eTcIvZlzh+jfWgyzZ N9C+Cl1QaJU5uL0amFM3mTt951yV3VwTr6zIyk+Ah0A8uOw3AYXex1gKVWCHaangJXIO Qaxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a170902e5ce00b001bbbbb61c67si3517623plf.542.2023.08.05.09.21.02; Sat, 05 Aug 2023 09:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229961AbjHEQCH (ORCPT + 99 others); Sat, 5 Aug 2023 12:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjHEQCG (ORCPT ); Sat, 5 Aug 2023 12:02:06 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECE4AE70 for ; Sat, 5 Aug 2023 09:02:04 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=liusong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Vp3juXZ_1691251304; Received: from localhost(mailfrom:liusong@linux.alibaba.com fp:SMTPD_---0Vp3juXZ_1691251304) by smtp.aliyun-inc.com; Sun, 06 Aug 2023 00:02:00 +0800 From: Liu Song To: akpm@linux-foundation.org, dianders@chromium.org, pmladek@suse.com Cc: liusong@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: [PATCH] watchdog/hardlockup: set watchdog_hardlockup_warned to true as early as possible Date: Sun, 6 Aug 2023 00:01:44 +0800 Message-Id: <20230805160144.121875-1-liusong@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we want to ensure only printing hardlockups once, it is necessary to set "watchdog_hardlockup_warned" to true as early as possible. Signed-off-by: Liu Song --- kernel/watchdog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 25d5627a6580..c4795f2d148c 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -180,6 +180,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs) /* Only print hardlockups once. */ if (per_cpu(watchdog_hardlockup_warned, cpu)) return; + else + per_cpu(watchdog_hardlockup_warned, cpu) = true; pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n", cpu); print_modules(); @@ -206,8 +208,6 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs) if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); - - per_cpu(watchdog_hardlockup_warned, cpu) = true; } else { per_cpu(watchdog_hardlockup_warned, cpu) = false; } -- 2.19.1.6.gb485710b