Lines Matching +full:- +full:affinity

1 // SPDX-License-Identifier: GPL-2.0
18 .affinity = false,
39 long total = res->false_hits + res->hits + res->drops; in false_hits_report_progress()
42 iter, (delta_ns - 1000000000) / 1000.0); in false_hits_report_progress()
45 res->false_hits, total, ((float)res->false_hits / total) * 100); in false_hits_report_progress()
71 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
73 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress()
76 iter, (delta_ns - 1000000000) / 1000.0); in hits_drops_report_progress()
90 gp_stat->mean += res[i].gp_ns / 1000.0 / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_latency_basic_stats()
92 #define IT_MEAN_DIFF (res[i].gp_ns / 1000.0 / (double)res[i].gp_ct - gp_stat->mean) in grace_period_latency_basic_stats()
95 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_latency_basic_stats()
97 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_latency_basic_stats()
108 gp_stat->mean += res[i].stime / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_ticks_basic_stats()
110 #define IT_MEAN_DIFF (res[i].stime / (double)res[i].gp_ct - gp_stat->mean) in grace_period_ticks_basic_stats()
113 gp_stat->stddev += (IT_MEAN_DIFF * IT_MEAN_DIFF) / (res_cnt - 1.0); in grace_period_ticks_basic_stats()
115 gp_stat->stddev = sqrt(gp_stat->stddev); in grace_period_ticks_basic_stats()
134 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in hits_drops_report_final()
135 (hits_mean - res[i].hits / 1000000.0) / in hits_drops_report_final()
136 (res_cnt - 1.0); in hits_drops_report_final()
137 drops_stddev += (drops_mean - res[i].drops / 1000000.0) * in hits_drops_report_final()
138 (drops_mean - res[i].drops / 1000000.0) / in hits_drops_report_final()
139 (res_cnt - 1.0); in hits_drops_report_final()
141 total_ops_stddev += (total_ops_mean - total_ops / 1000000.0) * in hits_drops_report_final()
142 (total_ops_mean - total_ops / 1000000.0) / in hits_drops_report_final()
143 (res_cnt - 1.0); in hits_drops_report_final()
161 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in ops_report_progress()
164 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in ops_report_progress()
179 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in ops_report_final()
180 (hits_mean - res[i].hits / 1000000.0) / in ops_report_final()
181 (res_cnt - 1.0); in ops_report_final()
196 hits_per_sec = res->hits / 1000000.0 / delta_sec; in local_storage_report_progress()
197 important_hits_per_sec = res->important_hits / 1000000.0 / delta_sec; in local_storage_report_progress()
199 printf("Iter %3d (%7.3lfus): ", iter, (delta_ns - 1000000000) / 1000.0); in local_storage_report_progress()
218 hits_stddev += (hits_mean - res[i].hits / 1000000.0) * in local_storage_report_final()
219 (hits_mean - res[i].hits / 1000000.0) / in local_storage_report_final()
220 (res_cnt - 1.0); in local_storage_report_final()
222 (important_hits_mean - res[i].important_hits / 1000000.0) * in local_storage_report_final()
223 (important_hits_mean - res[i].important_hits / 1000000.0) / in local_storage_report_final()
224 (res_cnt - 1.0); in local_storage_report_final()
244 "USAGE: benchmark <bench-name>\n"
247 " # run 'count-local' benchmark with 1 producer and 1 consumer\n"
248 " benchmark count-local\n"
249 " # run 'count-local' with 16 producer and 8 consumer thread, pinned to CPUs\n"
250 " benchmark -p16 -c8 -a count-local\n";
260 { "warmup", 'w', "SEC", 0, "Warm-up period, seconds"},
264 { "affinity", 'a', NULL, 0, "Set consumer/producer thread affinity"},
265 { "prod-affinity", ARG_PROD_AFFINITY_SET, "CPUSET", 0,
266 "Set of CPUs for producer threads; implies --affinity"},
267 { "cons-affinity", ARG_CONS_AFFINITY_SET, "CPUSET", 0,
268 "Set of CPUs for consumer threads; implies --affinity"},
311 fprintf(stderr, "Invalid warm-up duration: %s\n", arg); in parse_arg()
330 env.affinity = true; in parse_arg()
333 env.affinity = true; in parse_arg()
341 env.affinity = true; in parse_arg()
384 long delta_ns = new_time_ns - last_time_ns; in sigalarm_handler()
391 /* set up periodic 1-second timer */
403 fprintf(stderr, "failed to install SIGALRM handler: %d\n", -errno); in setup_timer()
410 fprintf(stderr, "failed to arm interval timer: %d\n", -errno); in setup_timer()
422 fprintf(stderr, "setting affinity to CPU #%d failed: %d\n", in set_thread_affinity()
430 if (cpu_set->cpus) { in next_cpu()
434 for (i = cpu_set->next_cpu; i < cpu_set->cpus_len; i++) { in next_cpu()
435 if (cpu_set->cpus[i]) { in next_cpu()
436 cpu_set->next_cpu = i + 1; in next_cpu()
444 return cpu_set->next_cpu++; in next_cpu()
544 if (strcmp(benchs[i]->name, env.bench_name) == 0) { in setup_benchmark()
554 printf("Setting up benchmark '%s'...\n", bench->name); in setup_benchmark()
563 if (bench->validate) in setup_benchmark()
564 bench->validate(); in setup_benchmark()
565 if (bench->setup) in setup_benchmark()
566 bench->setup(); in setup_benchmark()
570 bench->consumer_thread, (void *)(long)i); in setup_benchmark()
573 i, -errno); in setup_benchmark()
576 if (env.affinity) in setup_benchmark()
589 bench->producer_thread, (void *)(long)i); in setup_benchmark()
592 i, -errno); in setup_benchmark()
595 if (env.affinity) in setup_benchmark()
600 printf("Benchmark '%s' started.\n", bench->name); in setup_benchmark()
610 bench->measure(res); in collect_measurements()
612 if (bench->report_progress) in collect_measurements()
613 bench->report_progress(iter, res, delta_ns); in collect_measurements()
631 printf("- %s\n", benchs[i]->name); in main()
644 if (bench->report_final) in main()
646 bench->report_final(state.results + env.warmup_sec, in main()
647 state.res_cnt - env.warmup_sec); in main()