]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0012-Zpool-iostat-remove-latency-queue-scaling.patch
update/rebase to zfs-0.7.12 with patches from ZOL
[zfsonlinux.git] / zfs-patches / 0012-Zpool-iostat-remove-latency-queue-scaling.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Gregor Kopka <mailfrom-github@kopka.net>
3 Date: Wed, 26 Sep 2018 01:29:16 +0200
4 Subject: [PATCH] Zpool iostat: remove latency/queue scaling
5
6 Bandwidth and iops are average per second while *_wait are averages
7 per request for latency or, for queue depths, an instantaneous
8 measurement at the end of an interval (according to man zpool).
9
10 When calculating the first two it makes sense to do
11 x/interval_duration (x being the increase in total bytes or number of
12 requests over the duration of the interval, interval_duration in
13 seconds) to 'scale' from amount/interval_duration to amount/second.
14
15 But applying the same math for the latter (*_wait latencies/queue) is
16 wrong as there is no interval_duration component in the values (these
17 are time/requests to get to average_time/request or already an
18 absulute number).
19
20 This bug leads to the only correct continuous *_wait figures for both
21 latencies and queue depths from 'zpool iostat -l/q' being with
22 duration=1 as then the wrong math cancels itself (x/1 is a nop).
23
24 This removes temporal scaling from latency and queue depth figures.
25
26 Reviewed-by: Tony Hutter <hutter2@llnl.gov>
27 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
28 Signed-off-by: Gregor Kopka <gregor@kopka.net>
29 Closes #7945
30 Closes #7694
31 ---
32 cmd/zpool/zpool_main.c | 12 ++++++------
33 1 file changed, 6 insertions(+), 6 deletions(-)
34
35 diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
36 index a4fd0321..591e2e5c 100644
37 --- a/cmd/zpool/zpool_main.c
38 +++ b/cmd/zpool/zpool_main.c
39 @@ -3493,7 +3493,7 @@ single_histo_average(uint64_t *histo, unsigned int buckets)
40
41 static void
42 print_iostat_queues(iostat_cbdata_t *cb, nvlist_t *oldnv,
43 - nvlist_t *newnv, double scale)
44 + nvlist_t *newnv)
45 {
46 int i;
47 uint64_t val;
48 @@ -3523,7 +3523,7 @@ print_iostat_queues(iostat_cbdata_t *cb, nvlist_t *oldnv,
49 format = ZFS_NICENUM_1024;
50
51 for (i = 0; i < ARRAY_SIZE(names); i++) {
52 - val = nva[i].data[0] * scale;
53 + val = nva[i].data[0];
54 print_one_stat(val, format, column_width, cb->cb_scripted);
55 }
56
57 @@ -3532,7 +3532,7 @@ print_iostat_queues(iostat_cbdata_t *cb, nvlist_t *oldnv,
58
59 static void
60 print_iostat_latency(iostat_cbdata_t *cb, nvlist_t *oldnv,
61 - nvlist_t *newnv, double scale)
62 + nvlist_t *newnv)
63 {
64 int i;
65 uint64_t val;
66 @@ -3562,7 +3562,7 @@ print_iostat_latency(iostat_cbdata_t *cb, nvlist_t *oldnv,
67 /* Print our avg latencies on the line */
68 for (i = 0; i < ARRAY_SIZE(names); i++) {
69 /* Compute average latency for a latency histo */
70 - val = single_histo_average(nva[i].data, nva[i].count) * scale;
71 + val = single_histo_average(nva[i].data, nva[i].count);
72 print_one_stat(val, format, column_width, cb->cb_scripted);
73 }
74 free_calc_stats(nva, ARRAY_SIZE(names));
75 @@ -3701,9 +3701,9 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
76 print_iostat_default(calcvs, cb, scale);
77 }
78 if (cb->cb_flags & IOS_LATENCY_M)
79 - print_iostat_latency(cb, oldnv, newnv, scale);
80 + print_iostat_latency(cb, oldnv, newnv);
81 if (cb->cb_flags & IOS_QUEUES_M)
82 - print_iostat_queues(cb, oldnv, newnv, scale);
83 + print_iostat_queues(cb, oldnv, newnv);
84 if (cb->cb_flags & IOS_ANYHISTO_M) {
85 printf("\n");
86 print_iostat_histos(cb, oldnv, newnv, scale, name);