Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) 2015 Davidlohr Bueso.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) /* For the CLR_() macros */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <pthread.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "../util/stat.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <subcmd/parse-options.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/compiler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/zalloc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <internal/cpumap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <perf/cpumap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include "bench.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include "futex.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <err.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <stdlib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <sys/time.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) struct worker {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	int tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	u_int32_t *futex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	pthread_t thread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	unsigned long ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static u_int32_t global_futex = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static struct worker *worker;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static unsigned int nsecs = 10;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static bool silent = false, multi = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static bool done = false, fshared = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) static unsigned int nthreads = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static int futex_flag = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static pthread_mutex_t thread_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static unsigned int threads_starting;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static struct stats throughput_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) static pthread_cond_t thread_parent, thread_worker;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) static const struct option options[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	OPT_UINTEGER('t', "threads",  &nthreads, "Specify amount of threads"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	OPT_UINTEGER('r', "runtime", &nsecs,     "Specify runtime (in seconds)"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	OPT_BOOLEAN( 'M', "multi",   &multi,     "Use multiple futexes"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	OPT_BOOLEAN( 's', "silent",  &silent,    "Silent mode: do not display data/details"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	OPT_BOOLEAN( 'S', "shared",  &fshared,   "Use shared futexes instead of private ones"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	OPT_END()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) static const char * const bench_futex_lock_pi_usage[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	"perf bench futex lock-pi <options>",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) static void print_summary(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	unsigned long avg = avg_stats(&throughput_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	double stddev = stddev_stats(&throughput_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	       !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	       (int)bench__runtime.tv_sec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) static void toggle_done(int sig __maybe_unused,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			siginfo_t *info __maybe_unused,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			void *uc __maybe_unused)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	/* inform all threads that we're done for the day */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	done = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	gettimeofday(&bench__end, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	timersub(&bench__end, &bench__start, &bench__runtime);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) static void *workerfn(void *arg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	struct worker *w = (struct worker *) arg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	unsigned long ops = w->ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	pthread_mutex_lock(&thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	threads_starting--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	if (!threads_starting)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		pthread_cond_signal(&thread_parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	pthread_cond_wait(&thread_worker, &thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	pthread_mutex_unlock(&thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	again:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		ret = futex_lock_pi(w->futex, NULL, futex_flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		if (ret) { /* handle lock acquisition */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			if (!silent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 				warn("thread %d: Could not lock pi-lock for %p (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 				     w->tid, w->futex, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			if (done)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 			goto again;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		usleep(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		ret = futex_unlock_pi(w->futex, futex_flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		if (ret && !silent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			warn("thread %d: Could not unlock pi-lock for %p (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 			     w->tid, w->futex, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		ops++; /* account for thread's share of work */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	}  while (!done);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	w->ops = ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) static void create_threads(struct worker *w, pthread_attr_t thread_attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 			   struct perf_cpu_map *cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	cpu_set_t cpuset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	unsigned int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	threads_starting = nthreads;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	for (i = 0; i < nthreads; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		worker[i].tid = i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		if (multi) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 			worker[i].futex = calloc(1, sizeof(u_int32_t));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			if (!worker[i].futex)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 				err(EXIT_FAILURE, "calloc");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		} else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			worker[i].futex = &global_futex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		CPU_ZERO(&cpuset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		CPU_SET(cpu->map[i % cpu->nr], &cpuset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 			err(EXIT_FAILURE, "pthread_attr_setaffinity_np");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		if (pthread_create(&w[i].thread, &thread_attr, workerfn, &worker[i]))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 			err(EXIT_FAILURE, "pthread_create");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) int bench_futex_lock_pi(int argc, const char **argv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	unsigned int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	struct sigaction act;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	pthread_attr_t thread_attr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	struct perf_cpu_map *cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	argc = parse_options(argc, argv, options, bench_futex_lock_pi_usage, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	if (argc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		goto err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	cpu = perf_cpu_map__new(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	if (!cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		err(EXIT_FAILURE, "calloc");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	memset(&act, 0, sizeof(act));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	sigfillset(&act.sa_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	act.sa_sigaction = toggle_done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	sigaction(SIGINT, &act, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	if (!nthreads)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		nthreads = cpu->nr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	worker = calloc(nthreads, sizeof(*worker));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	if (!worker)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		err(EXIT_FAILURE, "calloc");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	if (!fshared)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		futex_flag = FUTEX_PRIVATE_FLAG;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	printf("Run summary [PID %d]: %d threads doing pi lock/unlock pairing for %d secs.\n\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	       getpid(), nthreads, nsecs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	init_stats(&throughput_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	pthread_mutex_init(&thread_lock, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	pthread_cond_init(&thread_parent, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	pthread_cond_init(&thread_worker, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	threads_starting = nthreads;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	pthread_attr_init(&thread_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	gettimeofday(&bench__start, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	create_threads(worker, thread_attr, cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	pthread_attr_destroy(&thread_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	pthread_mutex_lock(&thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	while (threads_starting)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		pthread_cond_wait(&thread_parent, &thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	pthread_cond_broadcast(&thread_worker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	pthread_mutex_unlock(&thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	sleep(nsecs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	toggle_done(0, NULL, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	for (i = 0; i < nthreads; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		ret = pthread_join(worker[i].thread, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 			err(EXIT_FAILURE, "pthread_join");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	/* cleanup & report results */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	pthread_cond_destroy(&thread_parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	pthread_cond_destroy(&thread_worker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	pthread_mutex_destroy(&thread_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	for (i = 0; i < nthreads; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		unsigned long t = bench__runtime.tv_sec > 0 ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			worker[i].ops / bench__runtime.tv_sec : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		update_stats(&throughput_stats, t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		if (!silent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 			printf("[thread %3d] futex: %p [ %ld ops/sec ]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 			       worker[i].tid, worker[i].futex, t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		if (multi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 			zfree(&worker[i].futex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	print_summary();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	free(worker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	perf_cpu_map__put(cpu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) err:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	usage_with_options(bench_futex_lock_pi_usage, options);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	exit(EXIT_FAILURE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) }