Very imprecise watchdogd(8) timeout

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Sep 16 20:03:11 UTC 2011


In message <CACqU3MWs0HHnZchOwmwWG8U9Vd2pBDKAqf6Pdw5zS_XO_S6Ppw at mail.gmail.com>
, Arnaud Lacombe writes:

>I just had a look to the way the timeout specified to watchdogd is
>passed to the kernel. watchdogd(8) says:

The API was designed for simplicity, not precision.

Watchdog hardware often have weird and strange limitations on the
actual values you can set.

A very typical, the most typical in my experience, is "some
frequency, a binary prescaler, possibly with a counter.

It is also not uncommon to have more than one watchdog
mechanism in the same system.

It would be overkill to design and implement a complex API to
communicate these limitations to userland.

So the API was designed around the power-of-two scale to give it
a wide range, and with the semantics "no shorter than", to make
it easy to use, and for multiple watchdogs to be engaged to the
best of their ability.

If this is not precise enough for you, come up with something
better.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-current mailing list