lkml.org 
[lkml]   [2013]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 2/2] watchdog: update watchdog_tresh properly
On Fri 19-07-13 12:08:52, Don Zickus wrote:
> On Fri, Jul 19, 2013 at 11:04:59AM +0200, Michal Hocko wrote:
> > watchdog_tresh controls how often nmi perf event counter checks per-cpu
> > hrtimer_interrupts counter and blows up if the counter hasn't changed
> > since the last check. The counter is updated by per-cpu watchdog_hrtimer
> > hrtimer which is scheduled with 2/5 watchdog_thresh period which
> > guarantees that hrtimer is scheduled 2 times per the main period. Both
> > hrtimer and perf event are started together when the watchdog is
> > enabled.
> >
> > So far so good. But...
> >
> > But what happens when watchdog_thresh is updated from sysctl handler?
> >
> > proc_dowatchdog will set a new sampling period and hrtimer callback
> > (watchdog_timer_fn) will use the new value in the next round.
> > The problem, however, is that nobody tells the perf event that the
> > sampling period has changed so it is ticking with the period configured
> > when it has been set up.
> >
> > This might result in an ear riping dissonance between perf and hrtimer
> > parts if the watchdog_thresh is increased. And even worse it might lead
> > to KABOOM if the watchdog is configured to panic on such a spurious
> > lockup.
>
> Heh. Good point.
>
> What if we keep it simpler.
>
> if (old_thresh != watchdog_thresh)
> watchdog_disable_all_cpus()
> wathcdog_enable_all_cpus()

Those would do nothing because of watchdog_disabled checks. It is also
much more heavy than necessary. I hope we can get a perf API which just
update the perf event period directly and we do not have to call even
watchdog_nmi_{en,dis}able

--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2013-07-19 19:01    [W:2.797 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site