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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 7BA00C433EF for ; Thu, 16 Sep 2021 08:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60E7B60F44 for ; Thu, 16 Sep 2021 08:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235060AbhIPIa1 (ORCPT ); Thu, 16 Sep 2021 04:30:27 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38816 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234309AbhIPIa0 (ORCPT ); Thu, 16 Sep 2021 04:30:26 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 6041022343; Thu, 16 Sep 2021 08:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631780945; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G97GCwmyfCkI6JmtTd8q5za/edjByNEk6qqCT0LjfvM=; b=WQJkUYQL5bmETUpztyvvPaesPsa53Cyg2kjkyAUTQXSyPKaq0AKL13x+xN6xmDu/cfDw8u mr5lnV3+Ig5550wNV4DtqlRbTCfdGgeeOKSVFaowTv9WFbdsyHVHfpiMHTS9+0RTeyRAWT s3o1XxXc3d81dWM+6loLOrHXSG3DFYE= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id F1D48A3B94; Thu, 16 Sep 2021 08:29:04 +0000 (UTC) Date: Thu, 16 Sep 2021 10:29:04 +0200 From: Petr Mladek To: Pingfan Liu Cc: linux-kernel@vger.kernel.org, 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 , Andrew Morton , Wang Qing , "Peter Zijlstra (Intel)" , Santosh Sivaraj Subject: Re: [PATCH 3/5] kernel/watchdog: adapt the watchdog_hld interface for async model Message-ID: References: <20210915035103.15586-1-kernelfans@gmail.com> <20210915035103.15586-4-kernelfans@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210915035103.15586-4-kernelfans@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2021-09-15 11:51:01, Pingfan Liu wrote: > When lockup_detector_init()->watchdog_nmi_probe(), PMU may be not ready > yet. E.g. 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 this > initialization before smp_init(). > > But it is easy to take an opposite approach by enabling watchdog_hld to > get the capability of PMU async. This is another cryptic description. I have probably got it after looking at the 5th patch (was not Cc :-( > The async model is achieved by introducing an extra parameter notifier > of watchdog_nmi_probe(). I would say that the code is horrible and looks too complex. What about simply calling watchdog_nmi_probe() and lockup_detector_setup() once again when watchdog_nmi_probe() failed in lockup_detector_init()? Or do not call lockup_detector_init() at all in kernel_init_freeable() when PMU is not ready yet. Best Regards, Petr