aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/zfs_znode.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-12-18 12:19:14 -0800
committerBrian Behlendorf <[email protected]>2016-01-15 15:33:44 -0800
commit0720116d4dd7a62d2097863fc4c32c3cbd11aefa (patch)
tree41a9f5bdc9c3c223a440129e33b5149207a45e04 /include/sys/zfs_znode.h
parentd21f279a94994f65e6bdcbbca9fd2eb552a0d604 (diff)
Add zfs_object_mutex_size module option
Add a zfs_object_mutex_size module option to facilitate resizing the the per-dataset znode mutex array. Increasing this value may help make the deadlock described in #4106 less common, but this is not a proper fix. This patch is primarily to aid debugging and analysis. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Issue #4106
Diffstat (limited to 'include/sys/zfs_znode.h')
-rw-r--r--include/sys/zfs_znode.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h
index 7e73cf991..59ca085ef 100644
--- a/include/sys/zfs_znode.h
+++ b/include/sys/zfs_znode.h
@@ -273,9 +273,15 @@ typedef struct znode {
/*
* Macros for dealing with dmu_buf_hold
*/
-#define ZFS_OBJ_HASH(obj_num) ((obj_num) & (ZFS_OBJ_MTX_SZ - 1))
+#define ZFS_OBJ_MTX_SZ 64
+#define ZFS_OBJ_MTX_MAX (1024 * 1024)
+
+extern unsigned int zfs_object_mutex_size;
+
+#define ZFS_OBJ_HASH(zsb, obj_num) \
+ ((obj_num) & ((zsb->z_hold_mtx_size) - 1))
#define ZFS_OBJ_MUTEX(zsb, obj_num) \
- (&(zsb)->z_hold_mtx[ZFS_OBJ_HASH(obj_num)])
+ (&(zsb)->z_hold_mtx[ZFS_OBJ_HASH(zsb, obj_num)])
#define ZFS_OBJ_HOLD_ENTER(zsb, obj_num) \
mutex_enter(ZFS_OBJ_MUTEX((zsb), (obj_num)))
#define ZFS_OBJ_HOLD_TRYENTER(zsb, obj_num) \