summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2018-03-04 17:34:51 -0800
committerTony Hutter <[email protected]>2018-03-14 16:10:38 -0700
commit6dc40e2ada2d0d008bd314ff3525f2b0acc2bb01 (patch)
treefcc344b5c688c1019aee4037073427927a35e3bc /include
parent792f88131c647a70440c709c78d43210db6c6534 (diff)
Change checksum & IO delay ratelimit values
Change checksum & IO delay ratelimit thresholds from 5/sec to 20/sec. This allows zed to actually trigger if a bunch of these events arrive in a short period of time (zed has a threshold of 10 events in 10 sec). Previously, if you had, say, 100 checksum errors in 1 sec, it would get ratelimited to 5/sec which wouldn't trigger zed to fault the drive. Also, convert the checksum and IO delay thresholds to module params for easy testing. Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #7252
Diffstat (limited to 'include')
-rw-r--r--include/sys/vdev_impl.h2
-rw-r--r--include/sys/zfs_ratelimit.h12
2 files changed, 9 insertions, 5 deletions
diff --git a/include/sys/vdev_impl.h b/include/sys/vdev_impl.h
index 13c495822..4f9f1a903 100644
--- a/include/sys/vdev_impl.h
+++ b/include/sys/vdev_impl.h
@@ -255,8 +255,6 @@ struct vdev {
* We rate limit ZIO delay and ZIO checksum events, since they
* can flood ZED with tons of events when a drive is acting up.
*/
-#define DELAYS_PER_SECOND 5
-#define CHECKSUMS_PER_SECOND 5
zfs_ratelimit_t vdev_delay_rl;
zfs_ratelimit_t vdev_checksum_rl;
};
diff --git a/include/sys/zfs_ratelimit.h b/include/sys/zfs_ratelimit.h
index f36e07841..012825fad 100644
--- a/include/sys/zfs_ratelimit.h
+++ b/include/sys/zfs_ratelimit.h
@@ -25,13 +25,19 @@
typedef struct {
hrtime_t start;
unsigned int count;
- unsigned int burst; /* Number to allow per interval */
- unsigned int interval; /* Interval length in seconds */
+
+ /*
+ * Pointer to number of events per interval. We do this to
+ * allow the burst to be a (changeable) module parameter.
+ */
+ unsigned int *burst;
+
+ unsigned int interval; /* Interval length in seconds */
kmutex_t lock;
} zfs_ratelimit_t;
int zfs_ratelimit(zfs_ratelimit_t *rl);
-void zfs_ratelimit_init(zfs_ratelimit_t *rl, unsigned int burst,
+void zfs_ratelimit_init(zfs_ratelimit_t *rl, unsigned int *burst,
unsigned int interval);
void zfs_ratelimit_fini(zfs_ratelimit_t *rl);