Skip to content

Commit ca2011b

Browse files
lzsaveradamdmoss
andcommitted
chksum: fix typos, add comments
ZFS-CI-Type: quick Signed-off-by: Alexx Saver <[email protected]> Co-authored-by: Adam Moss <[email protected]>
1 parent a11cce1 commit ca2011b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

module/zfs/zfs_chksum.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ typedef struct {
4949
zio_checksum_tmpl_free_t *(free);
5050
} chksum_stat_t;
5151

52+
/* a state machine for the benchmark: AT_STARTUP -> AT_BENCHMARK -> AT_DONE
53+
most likely, a blocking mechanism is needed in case of multiple requests */
54+
5255
#define AT_STARTUP 0
5356
#define AT_BENCHMARK 1
5457
#define AT_DONE 2
@@ -155,11 +158,11 @@ chksum_run(chksum_stat_t *cs, abd_t *abd, void *ctx, int round,
155158
switch (round) {
156159
case 1: /* 1k */
157160
size = 1<<10; loops = 128; break;
158-
case 2: /* 2k */
161+
case 2: /* 4k */
159162
size = 1<<12; loops = 64; break;
160-
case 3: /* 4k */
163+
case 3: /* 16k */
161164
size = 1<<14; loops = 32; break;
162-
case 4: /* 16k */
165+
case 4: /* 64k */
163166
size = 1<<16; loops = 16; break;
164167
case 5: /* 256k */
165168
size = 1<<18; loops = 8; break;
@@ -181,6 +184,7 @@ chksum_run(chksum_stat_t *cs, abd_t *abd, void *ctx, int round,
181184
} while (run_time_ns < MSEC2NSEC(1));
182185
kpreempt_enable();
183186

187+
/* will 64 bits always be enough to store the value? */
184188
run_bw = size * run_count * NANOSEC;
185189
run_bw /= run_time_ns; /* B/s */
186190
*result = run_bw/1024/1024; /* MiB/s */

0 commit comments

Comments
 (0)