watchdog: core: make sure the watchdog worker always works
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 8 Dec 2017 10:18:35 +0000 (11:18 +0100)
committerWim Van Sebroeck <wim@iguana.be>
Thu, 28 Dec 2017 19:45:57 +0000 (20:45 +0100)
commit38a1222ae4f364d5bd5221fe305dbb0889f45d15
treed75b37fae183f6482883b648807f7f21ee226178
parent71d1f058844de6052835549f06c113f5014a8290
watchdog: core: make sure the watchdog worker always works

When running a command like 'chrt -f 50 dd if=/dev/zero of=/dev/null',
the watchdog_worker fails to service the HW watchdog and the
HW watchdog fires long before the watchdog soft timeout.

At the moment, the watchdog_worker is invoked as a delayed work.
Delayed works are handled by non realtime kernel threads. The
WQ_HIGHPRI flag only increases the niceness of that threads.

This patch replaces the delayed work logic by kthread delayed work,
and sets the associated kernel task to SCHED_FIFO with the highest
priority, in order to ensure that the watchdog worker will run as
soon as possible.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/watchdog_dev.c