watchdog end-user interface

Alfred Perlstein alfred at freebsd.org
Thu Oct 20 07:30:20 UTC 2016



On 10/20/16 12:06 AM, Andriy Gapon wrote:
> On 20/10/2016 00:32, Alfred Perlstein wrote:
>>
>> On 10/19/16 4:09 AM, Andriy Gapon wrote:
>>> I know that there are people thinking about improving our watchdog
>>> infrastructure.  Maybe it's time to discuss some ideas in public.
>>>
>>> I would like to start with discussing the end-user, or rather administrative,
>>> interface to the watchdog system.
>>>
>>> watchdogd always had -t timeout option.
>>> Not a too long time ago it has also grown a handful of new options:
>>> --softtimeout
>>> --softtimeout-action action
>>> --pretimeout timeout
>>> --pretimeout-action action
>>>
>>> I want to question if those options really belong to watchdogd.
>>> When a watchdog timer expires that results in a system-wide action (like a
>>> system reset).  To me, that implies that there should be a single system-wide
>>> configuration point.  And I am not sure that the daemon is the best choice for
>>> it.
>>>
>>> Personally I would prefer a sysctl interface for the following reasons:
>>> - easier to change the configuration
>>> - easier to query current values
>>> - easier to signal that a value getting set may be different from a requested
>>> value
>>>
>>> In my opinion, watchdogd should only be concerned with running a check action
>>> and patting the dog(s).  And, by extension, WDIOCPATPAT should not re-configure
>>> the timeout, it should just reload the timers.
>>>
>> Please look at the Linux interface for watchdogs, it is pretty good and
>> could/should be ported to us.
> That's not what I actually wanted to discuss.
>
> Anyway, I had looked at it and I didn't find it a good model.
>
> I don't like that each watchdog driver creates its own device entry.
> I prefer the FreeBSD model where all drivers can work in concert.
> If the most popular Linux watchdog daemon is used, then you would need multiple
> instances of it (watchdog or wd_keepalive) to use multiple drivers.
>
> I don't like the seconds resolution.  It should be enough for everybody and,
> hey, it's better than our power-of-two resolution in the most used range.
> But I think that we could be even better.
>
> I do not like this (typical of Linux, I'd say):
>    The Linux watchdog API is a rather ad-hoc construction and different
>    drivers implement different, and sometimes incompatible, parts of it.
>
> There can be different opinions and different people can work towards different
> goal.  Personally, I do not have a goal of having Linux-like watchdog interface
> on FreeBSD.
>
> References:
> https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt
> https://www.kernel.org/doc/Documentation/watchdog/watchdog-kernel-api.txt
> http://linux.die.net/man/5/watchdog.conf
> https://sourceforge.net/p/watchdog/code/ci/master/tree/src/keep_alive.c?format=raw
> http://www.sat.dundee.ac.uk/psc/watchdog/Linux-Watchdog.html

  ¯\_(ツ)_/¯




More information about the freebsd-arch mailing list