From patchwork Wed Sep 15 03:50:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12495401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D172AC433F5 for ; Wed, 15 Sep 2021 03:53:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1A3A60724 for ; Wed, 15 Sep 2021 03:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1A3A60724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Rh1Lqb6Y2OS8lNAnITOlDMoCyXQZKJSqKFzBD1CCZw0=; b=jknMJULmyiQZII vsheXPgKCI81drwfJWhM35UTRcy6NOv8iBWEtzSS3Q8naxO32DwEiv3LiTHXKaJNQg1urtAGuPFEZ MT4vz6N+L/9B/sTIIWv57GtEkqURRTdJyeEUHlGlQ6dfh5rOK0CrRvKkD+zvevMBcn0HewryVyFuN 0GtOhdzHsg/sBPgtLAzpYURHzI60Rb9b83bmOx60a6BGNTwQerbmOtoZrDa/iWa9cP7S/SurAh2ai rALB4r3GxTfLuWClFt3QiH3aS1jgT/uzlaK7ZdbJ4tomf0zzuTcXdxpllGSpnPkCNw1jyBhaLOJ2W dCEFSwglTLiwa3qfw3Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQLxG-00808j-JR; Wed, 15 Sep 2021 03:51:26 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQLxD-008085-E5 for linux-arm-kernel@lists.infradead.org; Wed, 15 Sep 2021 03:51:24 +0000 Received: by mail-pf1-x42e.google.com with SMTP id j16so1499069pfc.2 for ; Tue, 14 Sep 2021 20:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=572jzkGxeL6YfJP3ZwAjXGhaawSUrfiEVlgivE5LFtc=; b=Qc1YKpfBh+BXdNeqFWOt9SMUtxZO32kP42rboAkSjl99bKxGkrwXTiWlTW2QF9VKNV eHWcBDFqviXzU6Ysxqj5Kd9wBxwE+gR39muUsdlccQ7f8k/IBYaj+lUvQnH+pjJsIHNL bDJQnijNX1yETGxIl22sGgFIBIYFlAG3ZDhjaNevHYgz5K7GGznNG3MePLno2L18F3tL MM/1OCijAmh7DiKVDjlkETdjwREs+Z9lxAKrO1q0ZRqhIJcJvz/31cITusOFaO88rOPR TjtIYSF5jgRxWerpVXe+3M/4p7Wt/pWdKR6ySLX+hwEw4keASVkLgovzlwWQrgONme69 elUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=572jzkGxeL6YfJP3ZwAjXGhaawSUrfiEVlgivE5LFtc=; b=gD0gG01C1T9+qUUGeXS/yJSrUW+dzmUoWcN6mlh25WyM4Lo4WlQwTbsw02Xqdqu64k zpv+R9KszIZ/88yUvB5KFAi76I+B8e5BBy/Fcu3xV878auiQTyuJ3ekamVF5Tq62xv4g GXjaZOHZuctTreXxUtluWW37s1SY4T16KD8nBatE1vRlDOXSwdVOnuBViZk5691UXQWa J4xCcsiWzWoNqA3pEY0g3vcypLhJldgQgWztIIgbFOR92lvgoxZV+ZxNRoFJuVWUgddH LJW1nU4jCQZ1dUcm8Tp+5O/EVaRBoDoCuiW0VK+6/gc2ILaMYcjgDFSjzJ/8M+0JBagJ Vg7Q== X-Gm-Message-State: AOAM5323rLSc47RKFfZYS03dak6WPXyyt0X9u9TRa/RlYz1663qC1mYx +BW5H7KQRhGRGf7kFJkA2CkP0Cx3Pw== X-Google-Smtp-Source: ABdhPJwS9T+vc3XhGASS4drRS336qlUtgAJ4PtZWtSSh4cQIzXsfF6HxEHPBJOPK4lqmgQx9cSjACA== X-Received: by 2002:a05:6a00:1147:b029:3e0:8c37:938e with SMTP id b7-20020a056a001147b02903e08c37938emr8101968pfm.65.1631677882118; Tue, 14 Sep 2021 20:51:22 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id x13sm8602357pfp.133.2021.09.14.20.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 20:51:21 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Pingfan Liu , Sumit Garg , Catalin Marinas , Will Deacon , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Marc Zyngier , Julien Thierry , Kees Cook , Masahiro Yamada , Sami Tolvanen , Petr Mladek , Andrew Morton , Wang Qing , "Peter Zijlstra (Intel)" , Santosh Sivaraj Subject: [PATCH 0/5] watchdog_hld cleanup and async model for arm64 Date: Wed, 15 Sep 2021 11:50:58 +0800 Message-Id: <20210915035103.15586-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210914_205123_522185_3A823BD8 X-CRM114-Status: GOOD ( 14.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org hard lockup detector is helpful to diagnose unpaired irq enable/disable. Sumit has tried with a series, and the last one is V5 [1]. Since it lasts a long time without any update, I takes a retry, which addresses the delay intialization of watchdog_hld. There is an obstacle to integrate arm64 hw perf event into watchdog_hld. When lockup_detector_init()->watchdog_nmi_probe(), on arm64, PMU is not ready until device_initcall(armv8_pmu_driver_init). And it is deeply integrated with the driver model and cpuhp. Hence it is hard to push the initialization of armv8_pmu_driver_init() before smp_init(). But it is easy to take an opposite approach by enabling watchdog_hld to get the capability of PMU async. The async model is achieved by introducing an extra parameter notifier of watchdog_nmi_probe(). In this series, [1-2/5] are trivial cleanup. [3-5/5] is for this async model. [1]: http://lore.kernel.org/linux-arm-kernel/1610712101-14929-1-git-send-email-sumit.garg@linaro.org Cc: Sumit Garg Cc: Catalin Marinas Cc: Will Deacon Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Marc Zyngier Cc: Julien Thierry Cc: Kees Cook Cc: Masahiro Yamada Cc: Sami Tolvanen Cc: Petr Mladek Cc: Andrew Morton Cc: Wang Qing Cc: "Peter Zijlstra (Intel)" Cc: Santosh Sivaraj To: linux-arm-kernel@lists.infradead.org To: linux-kernel@vger.kernel.org Pingfan Liu (5): kernel/watchdog: remove useless WATCHDOG_DEFAULT kernel/watchdog_hld: clarify the condition in hardlockup_detector_event_create() kernel/watchdog: adapt the watchdog_hld interface for async model kernel/watchdog_hld: simplify the detecting of hld watchdog arm64/watchdog_hld: enable hard lockup on arm64 platform arch/arm64/Kconfig | 3 ++ arch/arm64/include/asm/perf_event.h | 5 ++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/perf_event.c | 14 ++++- arch/arm64/kernel/watchdog_hld.c | 83 +++++++++++++++++++++++++++++ drivers/perf/arm_pmu.c | 5 ++ include/linux/nmi.h | 20 ++++--- kernel/watchdog.c | 69 ++++++++++++++++++------ kernel/watchdog_hld.c | 26 +++------ 9 files changed, 181 insertions(+), 45 deletions(-) create mode 100644 arch/arm64/kernel/watchdog_hld.c