MCPcopy Create free account
hub / github.com/F-Stack/f-stack / run_rec_bench_impl

Function run_rec_bench_impl

freebsd/contrib/openzfs/cmd/raidz_test/raidz_bench.c:143–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143static void
144run_rec_bench_impl(const char *impl)
145{
146 int fn, ncols, nbad;
147 uint64_t ds, iter_cnt, iter, disksize;
148 hrtime_t start;
149 double elapsed, d_bw;
150 static const int tgt[7][3] = {
151 {1, 2, 3}, /* rec_p: bad QR & D[0] */
152 {0, 2, 3}, /* rec_q: bad PR & D[0] */
153 {0, 1, 3}, /* rec_r: bad PQ & D[0] */
154 {2, 3, 4}, /* rec_pq: bad R & D[0][1] */
155 {1, 3, 4}, /* rec_pr: bad Q & D[0][1] */
156 {0, 3, 4}, /* rec_qr: bad P & D[0][1] */
157 {3, 4, 5} /* rec_pqr: bad & D[0][1][2] */
158 };
159
160 for (fn = 0; fn < RAIDZ_REC_NUM; fn++) {
161 for (ds = MIN_CS_SHIFT; ds <= MAX_CS_SHIFT; ds++) {
162
163 /* create suitable raidz_map */
164 ncols = rto_opts.rto_dcols + PARITY_PQR;
165 zio_bench.io_size = 1ULL << ds;
166
167 /*
168 * raidz block is too short to test
169 * the requested method
170 */
171 if (zio_bench.io_size / rto_opts.rto_dcols <
172 (1ULL << BENCH_ASHIFT))
173 continue;
174
175 if (rto_opts.rto_expand) {
176 rm_bench = vdev_raidz_map_alloc_expanded(
177 zio_bench.io_abd,
178 zio_bench.io_size, zio_bench.io_offset,
179 BENCH_ASHIFT, ncols+1, ncols,
180 PARITY_PQR, rto_opts.rto_expand_offset);
181 } else {
182 rm_bench = vdev_raidz_map_alloc(&zio_bench,
183 BENCH_ASHIFT, ncols, PARITY_PQR);
184 }
185
186 /* estimate iteration count */
187 iter_cnt = (REC_BENCH_MEMORY);
188 iter_cnt /= zio_bench.io_size;
189
190 /* calculate how many bad columns there are */
191 nbad = MIN(3, raidz_ncols(rm_bench) -
192 raidz_parity(rm_bench));
193
194 start = gethrtime();
195 for (iter = 0; iter < iter_cnt; iter++)
196 vdev_raidz_reconstruct(rm_bench, tgt[fn], nbad);
197 elapsed = NSEC2SEC((double)(gethrtime() - start));
198
199 disksize = (1ULL << ds) / rto_opts.rto_dcols;
200 d_bw = (double)iter_cnt * (double)(disksize);

Callers 1

run_rec_benchFunction · 0.85

Calls 5

vdev_raidz_map_allocFunction · 0.85
vdev_raidz_reconstructFunction · 0.85
vdev_raidz_map_freeFunction · 0.85
gethrtimeFunction · 0.50

Tested by

no test coverage detected