From patchwork Fri May 19 17:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 96548 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1408834vqo; Fri, 19 May 2023 10:39:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yh+qHu8SqY4zrX6S1yRmGPmvfyftYagRoD/+sEDNsLWz8Q5zD47/PgoVlD0Xg6otxKEsX X-Received: by 2002:a17:90a:628a:b0:24e:3c23:9654 with SMTP id d10-20020a17090a628a00b0024e3c239654mr2761963pjj.44.1684517944384; Fri, 19 May 2023 10:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684517944; cv=none; d=google.com; s=arc-20160816; b=MfJ88J8yQg7BF6+28zG8ua4HtQHB/OgJqKENDG9Ua+NxbtONOzKXN/mLmOAn27iOo1 6JHv5OR9Z/dT6d1T/k0eGkUyFAg2Mk+Uk32o+H5RBXxSaz63tb4KzLS8Y/1n8EsnK3g3 k9G+B+hDfwIcJxklJmk5D5DKPboUFitVUjFLSR7udLyYRhGDQeBh/5fXWuSCmpq54Vw+ 1w5nOcHVbc+kDR8smf4v7V2r7pxGR4/bLygAQL2+xWW6N/49BBSyIPLglBnKQs1YenAH F4lvF6Yubkrf2HJ6+uMWHbPq+nGOmP474WLtdicnG9a7qnYEFcXRxYpIqN+l0VvgJuOw 1rbg== 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 :dkim-signature; bh=02qH/DnpEiYKBFSrjaJ0Y79pipvrSaWo4CdISHdDfuc=; b=quBelEius9kahPnnbD1ux+fF1Cu4gsh5FRKxm0OLlH78RXgK4NQkWbVJ3/xn1GPgnf qcMgt4AuomkjWGcJfBqhgEMFUsJJfPIlMA31cGY4zAFxiBDUwR/QoDmj7qG6c8KHd+kX p7ajfLQaAskLAxmP+DsTfMBDAyHkwosqmXJJbTisK0LeiwNlEVepFocepkxlBmu7GVjG jJBcwxtTJnWLkhgtC4Qbhl6lSfScXG+pNFEhqt8ceLKG8XV0I7UzSBe1f/uJ+a3N3pnN HfXSyYcrCXYwokpgJd+azSJ4/mUECv4slAki7eEcxXXJNqHeAkKWIMGq6PD9NJtPlZWd nkcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cYOAMW20; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gx7-20020a17090b124700b00246b7a596eesi1974271pjb.146.2023.05.19.10.38.23; Fri, 19 May 2023 10:39:04 -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; dkim=pass header.i=@chromium.org header.s=google header.b=cYOAMW20; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbjESRUw (ORCPT + 99 others); Fri, 19 May 2023 13:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbjESRUn (ORCPT ); Fri, 19 May 2023 13:20:43 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1661139 for ; Fri, 19 May 2023 10:20:39 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2538183fb87so837778a91.0 for ; Fri, 19 May 2023 10:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684516839; x=1687108839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=02qH/DnpEiYKBFSrjaJ0Y79pipvrSaWo4CdISHdDfuc=; b=cYOAMW20yqCRPJAKXfPRAxxzdvsUVRoPpDVId2KBi/Ya8K8Kzoy918R2VyfOmmQpLH xI8S564KyK4m2N6iZQ7O4LLhfVTYWT/aktRMPSq7TkIBY5JsyjBlMimDAhUrZaP8Upp7 paWPEeT7J9fW6zw1WbJPkrytYOeDwTF4USR20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684516839; x=1687108839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=02qH/DnpEiYKBFSrjaJ0Y79pipvrSaWo4CdISHdDfuc=; b=eut7ZK2aiy3t6Faj4ov4jkCLFlQyW4rJbgCcSuU+yiqfnAtUSqkVJxEhjqtk2x4bBD YS3U7OPtjV8nvjM6ok3QFkUPCL6i+h4ytCx8sMuut2M138QHtXFulm+pTtd5gsbNu5mm ehOA33ca1umxda/A3TfHAjl4+Yxql/aqKsgQSrub3958h26Q34ssgjq662avu8El8sAC yg+KiuBYakIYhtdGQKl5PLYyl5BTE1G0MD9x/Ly/bDGGogaIsYFgKezfIovXNPw/cjJe 9G/Dc2OPrDLYHS1lXv0EjZjF+BisuLbSvtiRY/t2KVvwZlmwUq4O/xhh5Dh2cj7mkUly oDFQ== X-Gm-Message-State: AC+VfDzdj74JVQGBtVNbbeU8ipCuDJS4DwA6Sv5PwHgBYYuWWCrMmXZ1 OiyrkdVbMbRgCV11IZGel8xFJA== X-Received: by 2002:a17:90b:4b46:b0:253:6713:c7c2 with SMTP id mi6-20020a17090b4b4600b002536713c7c2mr2717286pjb.43.1684516839149; Fri, 19 May 2023 10:20:39 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:9b89:2dd0:d160:429d]) by smtp.gmail.com with ESMTPSA id gj19-20020a17090b109300b0024e4f169931sm1763835pjb.2.2023.05.19.10.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 10:20:38 -0700 (PDT) From: Douglas Anderson To: Petr Mladek , Andrew Morton Cc: Matthias Kaehlcke , kgdb-bugreport@lists.sourceforge.net, Stephane Eranian , mpe@ellerman.id.au, Tzung-Bi Shih , Daniel Thompson , Mark Rutland , linuxppc-dev@lists.ozlabs.org, Sumit Garg , npiggin@gmail.com, davem@davemloft.net, Marc Zyngier , Stephen Boyd , sparclinux@vger.kernel.org, christophe.leroy@csgroup.eu, Catalin Marinas , ravi.v.shankar@intel.com, Randy Dunlap , Pingfan Liu , Guenter Roeck , Lecopzer Chen , Ian Rogers , ito-yuichi@fujitsu.com, ricardo.neri@intel.com, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, Will Deacon , Chen-Yu Tsai , linux-kernel@vger.kernel.org, Masayoshi Mizuma , Andi Kleen , Douglas Anderson Subject: [PATCH v5 01/18] watchdog/perf: Define dummy watchdog_update_hrtimer_threshold() on correct config Date: Fri, 19 May 2023 10:18:25 -0700 Message-ID: <20230519101840.v5.1.I8cbb2f4fa740528fcfade4f5439b6cdcdd059251@changeid> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid> References: <20230519101840.v5.18.Ia44852044cdcb074f387e80df6b45e892965d4a1@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766345088206140539?= X-GMAIL-MSGID: =?utf-8?q?1766345088206140539?= The real watchdog_update_hrtimer_threshold() is defined in kernel/watchdog_hld.c. That file is included if CONFIG_HARDLOCKUP_DETECTOR_PERF and the function is defined in that file if CONFIG_HARDLOCKUP_CHECK_TIMESTAMP. The dummy version of the function in "nmi.h" didn't get that quite right. While this doesn't appear to be a huge deal, it's nice to make it consistent. It doesn't break builds because CHECK_TIMESTAMP is only defined by x86 so others don't get a double definition, and x86 uses perf lockup detector, so it gets the out of line version. Fixes: 7edaeb6841df ("kernel/watchdog: Prevent false positives with turbo modes") Reviewed-by: Nicholas Piggin Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- Changes in v5: - Add Nicholas's explanation of why this didn't break builds. - watchdog_hardlockup_perf.c => kernel/watchdog_hld.c in description. Changes in v4: - ("Define dummy watchdog_update_hrtimer_threshold() ...") new for v4. include/linux/nmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 048c0b9aa623..771d77b62bc1 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -197,7 +197,7 @@ u64 hw_nmi_get_sample_period(int watchdog_thresh); #endif #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP) && \ - defined(CONFIG_HARDLOCKUP_DETECTOR) + defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) void watchdog_update_hrtimer_threshold(u64 period); #else static inline void watchdog_update_hrtimer_threshold(u64 period) { }