summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-04-28 16:02:05 +0000
committerattilio <attilio@FreeBSD.org>2011-04-28 16:02:05 +0000
commitd685681d59c6feed493660adbeb6140c4fdab936 (patch)
treea77ab94179765e48d467fa200110ca442367a27e /sys/kern/kern_shutdown.c
parent3f732e147ff863c0e7572174a1a11f2e1f7c7053 (diff)
downloadFreeBSD-src-d685681d59c6feed493660adbeb6140c4fdab936.zip
FreeBSD-src-d685681d59c6feed493660adbeb6140c4fdab936.tar.gz
Add the watchdogs patting during the (shutdown time) disk syncing and
disk dumping. With the option SW_WATCHDOG on, these operations are doomed to let watchdog fire, fi they take too long. I implemented the stubs this way because I really want wdog_kern_* KPI to not be dependant by SW_WATCHDOG being on (and really, the option only enables watchdog activation in hardclock) and also avoid to call them when not necessary (avoiding not-volountary watchdog activations). Sponsored by: Sandvine Incorporated Discussed with: emaste, des MFC after: 2 weeks
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 9553a3a..001da3d 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include "opt_panic.h"
#include "opt_show_busybufs.h"
#include "opt_sched.h"
+#include "opt_watchdog.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,6 +66,9 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/sysproto.h>
+#ifdef SW_WATCHDOG
+#include <sys/watchdog.h>
+#endif
#include <ddb/ddb.h>
@@ -310,6 +314,9 @@ kern_reboot(int howto)
waittime = 0;
+#ifdef SW_WATCHDOG
+ wdog_kern_pat(WD_LASTVAL);
+#endif
sync(curthread, NULL);
/*
@@ -335,6 +342,9 @@ kern_reboot(int howto)
if (nbusy < pbusy)
iter = 0;
pbusy = nbusy;
+#ifdef SW_WATCHDOG
+ wdog_kern_pat(WD_LASTVAL);
+#endif
sync(curthread, NULL);
#ifdef PREEMPTION
OpenPOWER on IntegriCloud