lkml.org 
[lkml]   [2021]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-09-16 05:08    [W:0.074 / U:7.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site