summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/spa_misc.c
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2013-08-27 00:59:04 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2013-08-27 00:59:04 +0000
commit7bf5a6f485b8d8bb5c024482e916542997c5d6b6 (patch)
treef0a0bf8503f8174fd9b500feff8547cab885132d /usr/src/uts/common/fs/zfs/spa_misc.c
parentd907c5084d3f67c85c5551ee093457940f8aec17 (diff)
downloadillumos-joyent-7bf5a6f485b8d8bb5c024482e916542997c5d6b6.tar.gz
back out merge: incompatible ZFS throttling mechanisms
Diffstat (limited to 'usr/src/uts/common/fs/zfs/spa_misc.c')
-rw-r--r--usr/src/uts/common/fs/zfs/spa_misc.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/usr/src/uts/common/fs/zfs/spa_misc.c b/usr/src/uts/common/fs/zfs/spa_misc.c
index 65368b8379..2b8a071cb0 100644
--- a/usr/src/uts/common/fs/zfs/spa_misc.c
+++ b/usr/src/uts/common/fs/zfs/spa_misc.c
@@ -250,21 +250,18 @@ int zfs_flags = 0;
*/
int zfs_recover = 0;
-/*
- * Expiration time in milliseconds. This value has two meanings. First it is
- * used to determine when the spa_deadman() logic should fire. By default the
- * spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.
- * Secondly, the value determines if an I/O is considered "hung". Any I/O that
- * has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
- * in a system panic.
- */
-uint64_t zfs_deadman_synctime_ms = 1000000ULL;
+extern int zfs_txg_synctime_ms;
/*
- * Check time in milliseconds. This defines the frequency at which we check
- * for hung I/O.
+ * Expiration time in units of zfs_txg_synctime_ms. This value has two
+ * meanings. First it is used to determine when the spa_deadman logic
+ * should fire. By default the spa_deadman will fire if spa_sync has
+ * not completed in 1000 * zfs_txg_synctime_ms (i.e. 1000 seconds).
+ * Secondly, the value determines if an I/O is considered "hung".
+ * Any I/O that has not completed in zfs_deadman_synctime is considered
+ * "hung" resulting in a system panic.
*/
-uint64_t zfs_deadman_checktime_ms = 5000ULL;
+uint64_t zfs_deadman_synctime = 1000ULL;
/*
* Override the zfs deadman behavior via /etc/system. By default the
@@ -272,16 +269,6 @@ uint64_t zfs_deadman_checktime_ms = 5000ULL;
*/
int zfs_deadman_enabled = -1;
-/*
- * The worst case is single-sector max-parity RAID-Z blocks, in which
- * case the space requirement is exactly (VDEV_RAIDZ_MAXPARITY + 1)
- * times the size; so just assume that. Add to this the fact that
- * we can have up to 3 DVAs per bp, and one more factor of 2 because
- * the block may be dittoed with up to 3 DVAs by ddt_sync(). All together,
- * the worst case is:
- * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24
- */
-int spa_asize_inflation = 24;
/*
* ==========================================================================
@@ -512,15 +499,16 @@ spa_add(const char *name, nvlist_t *config, const char *altroot)
hdlr.cyh_arg = spa;
hdlr.cyh_level = CY_LOW_LEVEL;
- spa->spa_deadman_synctime = MSEC2NSEC(zfs_deadman_synctime_ms);
+ spa->spa_deadman_synctime = MSEC2NSEC(zfs_deadman_synctime *
+ zfs_txg_synctime_ms);
/*
* This determines how often we need to check for hung I/Os after
* the cyclic has already fired. Since checking for hung I/Os is
* an expensive operation we don't want to check too frequently.
- * Instead wait for 5 seconds before checking again.
+ * Instead wait for 5 synctimes before checking again.
*/
- when.cyt_interval = MSEC2NSEC(zfs_deadman_checktime_ms);
+ when.cyt_interval = MSEC2NSEC(5 * zfs_txg_synctime_ms);
when.cyt_when = CY_INFINITY;
mutex_enter(&cpu_lock);
spa->spa_deadman_cycid = cyclic_add(&hdlr, &when);
@@ -1511,7 +1499,14 @@ spa_freeze_txg(spa_t *spa)
uint64_t
spa_get_asize(spa_t *spa, uint64_t lsize)
{
- return (lsize * spa_asize_inflation);
+ /*
+ * The worst case is single-sector max-parity RAID-Z blocks, in which
+ * case the space requirement is exactly (VDEV_RAIDZ_MAXPARITY + 1)
+ * times the size; so just assume that. Add to this the fact that
+ * we can have up to 3 DVAs per bp, and one more factor of 2 because
+ * the block may be dittoed with up to 3 DVAs by ddt_sync().
+ */
+ return (lsize * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2);
}
uint64_t