From 08fc2f23b3cf04a540b1556463bb11cd99201796 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 24 Aug 2017 22:11:10 +0000 Subject: [PATCH] Expand the latency tracking array from 1.024s to 8.192s to help track extreme outliers from dodgy drives. Adjust comments to reflect this, and make sure that the number of latency buckets match in the two places where it matters. --- sys/cam/cam_iosched.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index 8b77b7d6c44..422096796d5 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -233,7 +233,7 @@ struct iop_stats { uint32_t state_flags; #define IOP_RATE_LIMITED 1u -#define LAT_BUCKETS 12 /* < 1ms < 2ms ... 512ms < 1024ms > 1024ms */ +#define LAT_BUCKETS 15 /* < 1ms < 2ms ... < 2^(n-1)ms >= 2^(n-1)ms*/ uint64_t latencies[LAT_BUCKETS]; struct cam_iosched_softc *softc; @@ -1520,7 +1520,7 @@ isqrt64(uint64_t val) return res; } -static sbintime_t latencies[] = { +static sbintime_t latencies[LAT_BUCKETS - 1] = { SBT_1MS << 0, SBT_1MS << 1, SBT_1MS << 2, @@ -1531,7 +1531,10 @@ static sbintime_t latencies[] = { SBT_1MS << 7, SBT_1MS << 8, SBT_1MS << 9, - SBT_1MS << 10 + SBT_1MS << 10, + SBT_1MS << 11, + SBT_1MS << 12, + SBT_1MS << 13 /* 8.192s */ }; static void