Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp612562pxb; Thu, 23 Sep 2021 07:12:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd7pmDqt/9phgGydxhRcRz2I0bGh0T7ZvXeEBlCrNtvK/tL+G/l+G80/eggbIc2uekZ/Kx X-Received: by 2002:a5d:9c88:: with SMTP id p8mr4166271iop.153.1632406374530; Thu, 23 Sep 2021 07:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632406374; cv=none; d=google.com; s=arc-20160816; b=O+0e4IfV28s9uzE2jWAFhPKI4ZGSD1wfUgMgCVdAl3RCKrMCiQR7mH0qZCySCkzDMp 3b5WGK52BEGXi3yuGB40nSJBapoA8u3eYiK1w9amsyManmadmp4xv0gtgffBbKBFt6fA mljzd4QTnPnFXIWDfQve/ReY1NAxwOBYPPGVrY0ZVMUVWNjIEzIkdXDZ+Yoj5xx90j3V YAYtvLFgE/z43cJEzIr8KZsQXH4vFgjjzqGZkIcXZaANB1P7GCm0WviTNVQNBQxv1r5E 7Q2kgg5ldZXkDce3fQSyO0UnWc4Uc9jDGjqFf2fmIvUkdmRGasfXEdza2VpiKUh2x3M3 Nang== 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:dkim-signature; bh=bs8p7jBvxim/Kr15A2OV4dN2/Mya/1qDXohd6hFoZU8=; b=f+36BQV3FF0PctkfnuogcAUckoS6fmgyBOVmiC4U26Klo655hOU1F5xZz8IwgIyjEX rO1uuOOxUTy1FPEZDB2jSKkH3OPou21x681W7URr7Kzj6UI2TeGYXBvpX17kIekobyo5 dqFEuXwL7bApjpOE+vvn+D2eJbyvmY46Mw5QE4/LhVzb8Gkk4lIuq4cTwnLMvTYCWBVd rKPfpsaC5e7ACrkN3/ndPUt2ZFe/K3WJ6v4vYxDhQS0wTTRsvfyfmodOFmMo05g0YgzZ 51iTE4RqVIrc/D2nxdQbR928ZqSqqo6sRbTMeqOq346yvvNIBAEq19TYT7aMLlnWh5i7 uwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hhQZH3A2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si6838457ilv.110.2021.09.23.07.12.30; Thu, 23 Sep 2021 07:12:54 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hhQZH3A2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241665AbhIWOLw (ORCPT + 99 others); Thu, 23 Sep 2021 10:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241645AbhIWOLv (ORCPT ); Thu, 23 Sep 2021 10:11:51 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F00D5C061756 for ; Thu, 23 Sep 2021 07:10:19 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id r2so6436917pgl.10 for ; Thu, 23 Sep 2021 07:10:19 -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=bs8p7jBvxim/Kr15A2OV4dN2/Mya/1qDXohd6hFoZU8=; b=hhQZH3A2YahkZIGyCB11t8MDcxyoHxC3hwtw1e3SDnawMLSo1u+fV76diWFr7dR2VY 1RyitLX3DOn+Jy51CbVQeMMVa+DudjAxej6/vunZFV1qoxt9ppaoB7ZfORi73SKec2oI g+29SO6QIvw1XXIlr9O2UBjUXifiEO0ciK1i8qCisIDgcWDC0GOiy130wL213Y+EvftL 74fySXt/IwXr/hkkfn7Tg2s+EK4bl2C7goHXDZja13BV4bXIrOGSZqEz/0gKZ36M3L7F OA6x1ULdK3uArS/OjrOs+nnUM8rVmmoRYXQlS6Dm18a98t9Ab2PC9UGRXHhITcHOD0nx 4yiw== 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=bs8p7jBvxim/Kr15A2OV4dN2/Mya/1qDXohd6hFoZU8=; b=jIA6Of71kNmnAfacF+iEckyQ+e9KHPcUMyzJwznoo4cFtnx5MzYaXNr3PXqgpPsFDk nLcYagpIPxcsLfIZqC79YILcEVVJ2tK50KDbpKCReBn/3960ABLwbjfJdK2SPna/QH71 w4Xd9HPidtEn9YlmuauMLNPXp52bQod7u1Zgp/zlk26+2VO6Np4m63Fo0Xf1NdEwwjhy Jc9O69+dVit6gHYGsC0sFjm2/uVk3hn+2WgtvZRC+GGSDkBZEt0JbzbLoyEtUCI+laFE Jw1rRyWNIzjbz8y56+uAwV7bO0rtzBfro+Do5rYjzoU33DpZghKHQ8cZHGFFTZsaLsIG bivw== X-Gm-Message-State: AOAM533nCK+pPLpKAGgcJR3DuC/k9PndSSZJS0OYeJFlyVPM4WlkC3c0 KfGX1ujqPk3qDVzfyLHhFg== X-Received: by 2002:a63:b252:: with SMTP id t18mr4415027pgo.14.1632406219483; Thu, 23 Sep 2021 07:10:19 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id j6sm5800766pfn.107.2021.09.23.07.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Sep 2021 07:10:18 -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: [PATCHv2 0/4] watchdog_hld cleanup and async model for arm64 Date: Thu, 23 Sep 2021 22:09:47 +0800 Message-Id: <20210923140951.35902-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. ( To: Sumit, I think the main body of [4/4] is contributed from you,so I keep you as the author, please let me know if you dislike it and my modification.) 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 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. 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. [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: 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: clarify the condition in hardlockup_detector_event_create() 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 +++++++++++++++++++++++++++ drivers/perf/arm_pmu.c | 5 ++++ include/linux/nmi.h | 5 +++- include/linux/perf/arm_pmu.h | 2 ++ kernel/watchdog.c | 42 +++++++++++++++++++++++++++----- kernel/watchdog_hld.c | 5 +++- 9 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 arch/arm64/kernel/watchdog_hld.c -- 2.31.1