Commit 4ebb1f9b authored by Julia Cartwright's avatar Julia Cartwright Committed by Steven Rostedt
Browse files

watchdog: prevent deferral of watchdogd wakeup on RT



When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are
deferred for execution into the context of ktimersoftd unless otherwise
annotated.

Deferring the expiry of the hrtimer used by the watchdog core, however,
is a waste, as the callback does nothing but queue a kthread work item
and wakeup watchdogd.

It's worst then that, too: the deferral through ktimersoftd also means
that for correct behavior a user must adjust the scheduling parameters
of both watchdogd _and_ ktimersoftd, which is unnecessary and has other
side effects (like causing unrelated expiry functions to execute at
potentially elevated priority).

Instead, mark the hrtimer used by the watchdog core as being _HARD to
allow it's execution directly from hardirq context.  The work done in
this expiry function is well-bounded and minimal.

A user still must adjust the scheduling parameters of the watchdogd
to be correct w.r.t. their application needs.

Cc: Guenter Roeck <linux@roeck-us.net>
Reported-and-tested-by: default avatarSteffen Trumtrar <s.trumtrar@pengutronix.de>
Reported-by: default avatarTim Sander <tim@krieglstein.org>
Signed-off-by: default avatarJulia Cartwright <julia@ni.com>
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
[bigeasy: use only HRTIMER_MODE_REL_HARD]
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
parent fb66fc28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment