[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUK06iqiCwiIvpRM@piliu.users.ipa.redhat.com>
Date: Thu, 16 Sep 2021 11:07:22 +0800
From: Pingfan Liu <piliu@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Pingfan Liu <kernelfans@...il.com>, 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 04:02:28PM +0200, Peter Zijlstra wrote:
> 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..
>
Sorry for a bad expression. what I mean is: this patch [3/5] provides an
framework for async model. But since watchdog_nmi_probe() still return 0 or
-ENODEV after this patch, the code's behavior is the same as original.
Does it make sense to you?
> > +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..
>
Oh, check other codes, for a wrapped condition, blanks should be better choice.
> > + 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.
Ditto.
Thanks for your comment and review.
Regards,
Pingfan
Powered by blists - more mailing lists