Skip to contentSkip to conversation

Add module param to configure watchdog timeout

PATCH New Jan Kiszka 1 participant 1 message Mar 18, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Add module param to configure watchdog timeout

This allows to play with larger watchdog timeouts without requiring the user to recompile the kernel to find out if an overload situation is permanent or transient.

---

 ksrc/nucleus/sched.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
ksrc/nucleus/sched.c +6 -2
index e740d26..77f5a4b 100644
@@ -49,6 +49,10 @@ int xnsched_register_class(struct xnsched_class *sched_class)
 
 #ifdef CONFIG_XENO_OPT_WATCHDOG
 
+static u_long wd_timeout_arg = CONFIG_XENO_OPT_WATCHDOG_TIMEOUT;
+module_param_named(watchdog_timeout, wd_timeout_arg, ulong, 0444);
+MODULE_PARM_DESC(watchdog_timeout, "Watchdog timeout (s)");
+
 /*! 
  * @internal
  * \fn void xnsched_watchdog_handler(struct xntimer *timer)
@@ -69,8 +73,8 @@ static void xnsched_watchdog_handler(struct xntimer *timer)
 		xnsched_reset_watchdog(sched);
 		return;
 	}
-		
-	if (unlikely(++sched->wdcount >= CONFIG_XENO_OPT_WATCHDOG_TIMEOUT)) {
+
+	if (unlikely(++sched->wdcount >= wd_timeout_arg)) {
 		trace_mark(xn_nucleus, watchdog, "thread %p thread_name %s",
 			   thread, xnthread_name(thread));
 		xnprintf("watchdog triggered -- killing runaway thread '%s'\n",