summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2013-02-25 12:33:31 +0000
committermm <mm@FreeBSD.org>2013-02-25 12:33:31 +0000
commit935fd1194aa4a1bf2f3e80315a915faa331dc729 (patch)
treeec42bfc38bb1575d8989dd9b950b2a8672bdf3cd /cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
parent75d62de01add614d86b5cf30bd3b8157f26d2812 (diff)
downloadFreeBSD-src-935fd1194aa4a1bf2f3e80315a915faa331dc729.zip
FreeBSD-src-935fd1194aa4a1bf2f3e80315a915faa331dc729.tar.gz
MFV v242732:
Merge the ZFS I/O deadman thread from vendor (illumos). This feature panics the system on hanging ZFS I/O, helps debugging and resumes failed service. The panic behavior can be controlled with the loader-only tunables: vfs.zfs.deadman_enabled (enable or disable panic on stalled ZFS I/O) vfs.zfs.deadman_synctime (expiration time for stalled ZFS I/O) By default, ZFS I/O deadman is enabled by default on amd64 and i386 excluding virtual guest machines. Illumos ZFS issues: 3246 ZFS I/O deadman thread References: https://www.illumos.org/issues/3246 MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzpool/common/kernel.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/kernel.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
index 56bf718..25dc520 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
@@ -45,6 +45,9 @@ int aok;
uint64_t physmem;
vnode_t *rootdir = (vnode_t *)0xabcd1234;
char hw_serial[HW_HOSTID_LEN];
+#ifdef illumos
+kmutex_t cpu_lock;
+#endif
struct utsname utsname = {
"userland", "libzpool", "1", "1", "na"
@@ -842,6 +845,28 @@ ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result)
return (0);
}
+#ifdef illumos
+/* ARGSUSED */
+cyclic_id_t
+cyclic_add(cyc_handler_t *hdlr, cyc_time_t *when)
+{
+ return (1);
+}
+
+/* ARGSUSED */
+void
+cyclic_remove(cyclic_id_t id)
+{
+}
+
+/* ARGSUSED */
+int
+cyclic_reprogram(cyclic_id_t id, hrtime_t expiration)
+{
+ return (1);
+}
+#endif
+
/*
* =========================================================================
* kernel emulation setup & teardown
@@ -875,6 +900,10 @@ kernel_init(int mode)
system_taskq_init();
+#ifdef illumos
+ mutex_init(&cpu_lock, NULL, MUTEX_DEFAULT, NULL);
+#endif
+
spa_init(mode);
}
OpenPOWER on IntegriCloud