[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUH89GX1RB8fdcvh@hirez.programming.kicks-ass.net>
Date: Wed, 15 Sep 2021 16:02:28 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Pingfan Liu <kernelfans@...il.com>
Cc: linux-kernel@...r.kernel.org, Sumit Garg <sumit.garg@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Marc Zyngier <maz@...nel.org>,
Julien Thierry <jthierry@...hat.com>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Petr Mladek <pmladek@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Wang Qing <wangqing@...o.com>,
Santosh Sivaraj <santosh@...six.org>
Subject: Re: [PATCH 3/5] kernel/watchdog: adapt the watchdog_hld interface
for async model
On Wed, Sep 15, 2021 at 11:51:01AM +0800, 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.
>
> The async model is achieved by introducing an extra parameter notifier
> of watchdog_nmi_probe().
>
> Note after this patch, the async model, which is utilized by the next
> patch, does not take effect yet.
I can't make any sense of what you're trying to do..
> +static void watchdog_nmi_report_capability(struct watchdog_nmi_status *data)
> +{
> + /* Set status to 1 temporary to block any further access */
> + if (atomic_cmpxchg((atomic_t *)&nmi_watchdog_status, -EBUSY, 1)
> + == -EBUSY) {
But this..
> + if (!data->status) {
> + nmi_watchdog_status = 0;
> + lockup_detector_update_enable();
> + } else {
> + nmi_watchdog_status = -ENODEV;
> + /* turn offf watchdog_enabled forever */
> + lockup_detector_update_enable();
> + pr_info("Perf NMI watchdog permanently disabled\n");
> + }
> + }
> +}
> @@ -467,7 +494,8 @@ static void watchdog_enable(unsigned int cpu)
> /* Initialize timestamp */
> update_touch_ts();
> /* Enable the perf event */
> - if (watchdog_enabled & NMI_WATCHDOG_ENABLED)
> + if (watchdog_enabled &
> + (NMI_WATCHDOG_ENABLED | NMI_WATCHDOG_UNDETERMINED))
and this, are horrible indenting.
Powered by blists - more mailing lists