From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EA8AC433EF for ; Thu, 14 Oct 2021 02:45:09 +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 DCDEE61130 for ; Thu, 14 Oct 2021 02:45:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DCDEE61130 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=+xT+B+UfM0pGyXQoz0cuZu8O1YPlbmfiwxY7K9ENAhE=; b=QUDDD7TfwuHh7R ZQRfU4GXv82Ful7AVBBIoV6zqzxPvmEA1KRNEjMkf46u6FxHDqfsrMpIh9vlp4kNjLny7lNEtCZhf 72gp9IpCq2WN2G6YVp60Grf3qGFh0uKZ54Pq5baveK2RKZKHw1/t9aI/fpwQWcpnxV+7XOJ4vi9dC kF33zhYp9ysgWKTHHet8TCDTMf2rbGb1OrqwZvGgxvENgk8XCqeCWyIusf+w1K966RK/wz+OtIBDD xowPRcLjpP5cSVB9wWqBUftSoEvXsXnySFGpyg8QQJPi4sCZvZWujJPZfFZM6RodTytr84V2JPucZ ddhoCuy7LPtEjwh3Tvcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1maqhD-001Ibx-7N; Thu, 14 Oct 2021 02:42:15 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1maqh9-001IZz-EL for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 02:42:12 +0000 Received: by mail-pj1-x1029.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so5856582pjb.5 for ; Wed, 13 Oct 2021 19:42:08 -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=UW8XCIeIeYrdlOb1ZarORXLPpqtbURryzGPGlwjnyHI=; b=ewqlgzauj8v3/fH2C4jFtb9CERAHLe+frilxffMXj9puV07vHNyOxaZ7hxjJkdGkkA vy4u8blFLS2lIr6L1j0+E6tlAYRfzeboaGh914vvtb55JUcHiQrfcDfiRpGX1gkQdVer OTjCiM/Nizdxfv4qDG/0VYd1FIlTlJcuqZVKep/CNaNOb+ns7s4068v0pcMom1EeR+N9 /pOCFiiv5ZOMaRai/YIdZBiKadL5kXnhEfsXGbeZ2zfAHVrvQTkfZ6GoUbJjRcwDSGOW abe4Zw7R1fjVnBdXYF1awAGcAO55gKA/WK0a0U4zwRHGeFBBY01nLm0kTh2TT3GZRdLI 2eKw== 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=UW8XCIeIeYrdlOb1ZarORXLPpqtbURryzGPGlwjnyHI=; b=zBf+y75kk8yMEMuSv4xpIAd9CmovbnEsEI9Vrvz9FdsTJPOcRNM17tdRwHFINDg6Ey waBjwCdc0nr33wyEoR95v5iRq/sXosvjirA0R9oipzuR7xR1Qt6KU9rA1H17k1VnTJde V+JSj0qk1oT16XejnRPsccaS/DgcmC6qkN6RYt1fhbhpAXsZ7gCgWnf01RUpqQZj+Mf9 EmMkU1KKk4UlJ9FKAR2bUU38RwXRGkRyTD/C82sltPxFDn9kcHpmBTXVjXheQCLl8mTP LiiLSMufnGrM/+9DzxvRTw9J/uQTQCrnFP3KHlah5cQRqrVBEy6mxw7A/DitzZvkraGc Nchg== X-Gm-Message-State: AOAM530yineGUAqPxGqOrtGXad8fdTc06MRzDJZ8P89YtI8j4sMPfhOl I6FGbOimcgTNMT5tVKug6PGygut0sQ== X-Google-Smtp-Source: ABdhPJykR01YldoWb1AVKlZxFUw/plpEy+PT1HfAokp7fgk120udLXyPbD3R4SHBGnnS40Yles/qxg== X-Received: by 2002:a17:903:22cc:b0:13e:fa73:6fef with SMTP id y12-20020a17090322cc00b0013efa736fefmr2771601plg.25.1634179328296; Wed, 13 Oct 2021 19:42:08 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id m28sm818403pgl.9.2021.10.13.19.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 19:42:07 -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 , Kees Cook , Masahiro Yamada , Sami Tolvanen , Petr Mladek , Andrew Morton , Wang Qing , "Peter Zijlstra (Intel)" , Santosh Sivaraj Subject: [PATCHv3 0/4] watchdog_hld cleanup and async model for arm64 Date: Thu, 14 Oct 2021 10:41:51 +0800 Message-Id: <20211014024155.15253-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-20211013_194211_512944_33C610DB X-CRM114-Status: GOOD ( 14.06 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. But the current watchdog framework can not cope with arm64 hw perf event easily. On arm64, when lockup_detector_init()->watchdog_nmi_probe(), 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 expanding watchdog_nmi_probe() with -EBUSY, and a re-initializing work_struct which waits on a wait_queue_head. In this series, [1-2/4] are trivial cleanup. [3-4/4] is for this async model. v2 -> v3: check the delay work waken up and flush the work before __initdata is free. improve the commit log of [4/4] rebase to v5.15-rc5 v1 > v2: uplift the async model from hard lockup layer to watchdog layter. The benefit is simpler code, the drawback is re-initialize means wasted alloc/free. 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: 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 *** BLURB HERE *** Pingfan Liu (3): kernel/watchdog: trival cleanups kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector event kernel/watchdog: Adapt the watchdog_hld interface for async model Sumit Garg (1): arm64: Enable perf events based hard lockup detector arch/arm64/Kconfig | 2 ++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/perf_event.c | 11 ++++-- arch/arm64/kernel/watchdog_hld.c | 36 +++++++++++++++++++ arch/sparc/kernel/nmi.c | 8 ++--- drivers/perf/arm_pmu.c | 5 +++ include/linux/nmi.h | 11 +++++- include/linux/perf/arm_pmu.h | 2 ++ kernel/watchdog.c | 62 ++++++++++++++++++++++++++++---- kernel/watchdog_hld.c | 5 ++- 10 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 arch/arm64/kernel/watchdog_hld.c -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel