40 #define MAX_NUM_THREADS 30 41 #define KB(x) ((x) * 1024) 42 #define MB(x) (KB(x) * 1024) 65 uint32_t block_size, uint32_t th_num)
80 for (
i = 0;
i < data_count; ++
i) {
93 for (
i = 0;
i < parity_count; ++
i) {
105 fail_count = (th_num % parity_count) + 1;
106 for (
i = 0;
i < fail_count;) {
141 if (i < cfg->tc_data_count)
159 if (i < cfg->tc_data_count)
177 uint32_t fail_count = data_count + parity_count;
181 struct m0_buf *parity_buf = 0;
194 for (
i = 0;
i < data_count; ++
i)
197 for (
i = 0;
i < parity_count; ++
i)
217 uint32_t parity_count,
233 for (
i = 0;
i < num_threads;
i++) {
234 tb_cfg_init(&cfg[
i], data_count, parity_count, block_size,
i);
241 for (
i = 0;
i < num_threads;
i++) {
302 .
us_name =
"parity-math-mt-ub",
307 { .ub_name =
"s 10/03/ 4K",
310 .ub_block_size =
KB(4),
313 { .ub_name =
"m 20/04/ 4K",
316 .ub_block_size =
KB(4),
319 { .ub_name =
"l 30/04/ 4K",
322 .ub_block_size =
KB(4),
325 { .ub_name =
"s 10/03/ 32K",
328 .ub_block_size =
KB(32),
331 { .ub_name =
"m 20/04/ 32K",
334 .ub_block_size =
KB(32),
337 { .ub_name =
"l 30/04/ 32K",
340 .ub_block_size =
KB(32),
343 { .ub_name =
"s 10/05/ 1M",
346 .ub_block_size =
MB(1),
349 { .ub_name =
"m 20/04/ 1M",
352 .ub_block_size =
MB(1),
355 { .ub_name =
"l 30/04/ 1M",
358 .ub_block_size =
MB(1),
361 { .ub_name =
"s 04/02/ 4K",
364 .ub_block_size = 4096,
367 { .ub_name =
"m 04/02/256K",
370 .ub_block_size = 262144,
373 { .ub_name =
"l 04/02/ 1M",
376 .ub_block_size = 1048576,
M0_INTERNAL void m0_parity_math_fini(struct m0_parity_math *math)
#define M0_ALLOC_ARR(arr, nr)
void tb_thread(struct tb_cfg *cfg)
int m0_thread_join(struct m0_thread *q)
struct m0_ub_set m0_parity_math_mt_ub
static int ub_init(const char *opts M0_UNUSED)
void tb_cfg_init(struct tb_cfg *cfg, uint32_t data_count, uint32_t parity_count, uint32_t block_size, uint32_t th_num)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
static void ub_small_4_2_256K(int iter)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
M0_INTERNAL int m0_parity_math_recover(struct m0_parity_math *math, struct m0_buf *data, struct m0_buf *parity, struct m0_buf *fails, enum m0_parity_linsys_algo algo)
static void ub_small_4_2_4K(int iter)
M0_INTERNAL void m0_parity_math_calculate(struct m0_parity_math *math, struct m0_buf *data, struct m0_buf *parity)
void tb_cfg_fini(struct tb_cfg *cfg)
M0_INTERNAL int m0_parity_math_init(struct m0_parity_math *math, uint32_t data_count, uint32_t parity_count)
void * m0_alloc(size_t size)
static void ub_mt_test(uint32_t data_count, uint32_t parity_count, uint32_t block_size)
M0_INTERNAL uint64_t m0_rnd64(uint64_t *seed)
static void ub_small_4_2_1M(int iter)
static void unit_spoil(struct tb_cfg *cfg)
static void unit_compare(struct tb_cfg *cfg)