aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/bench/futex.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2025-04-16 18:29:19 +0200
committerPeter Zijlstra <peterz@infradead.org>2025-05-03 12:02:10 +0200
commit60035a3981a7f9d965df81a48a07b94e52ccd54f (patch)
treeba73a5f5e01b367a87b8208b851923908660a96a /tools/perf/bench/futex.h
parenttools headers: Synchronize prctl.h ABI header (diff)
downloadwireguard-linux-60035a3981a7f9d965df81a48a07b94e52ccd54f.tar.xz
wireguard-linux-60035a3981a7f9d965df81a48a07b94e52ccd54f.zip
tools/perf: Allow to select the number of hash buckets
Add the -b/ --buckets argument to specify the number of hash buckets for the private futex hash. This is directly passed to prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, buckets, immutable) and must return without an error if specified. The `immutable' is 0 by default and can be set to 1 via the -I/ --immutable argument. The size of the private hash is verified with PR_FUTEX_HASH_GET_SLOTS. If PR_FUTEX_HASH_GET_SLOTS failed then it is assumed that an older kernel was used without the support and that the global hash is used. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20250416162921.513656-20-bigeasy@linutronix.de
Diffstat (limited to '')
-rw-r--r--tools/perf/bench/futex.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index ebdc2b032afc..9c9a73f9d865 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -25,6 +25,8 @@ struct bench_futex_parameters {
unsigned int nfutexes;
unsigned int nwakes;
unsigned int nrequeue;
+ int nbuckets;
+ bool buckets_immutable;
};
/**
@@ -143,4 +145,7 @@ futex_cmp_requeue_pi(u_int32_t *uaddr, u_int32_t val, u_int32_t *uaddr2,
val, opflags);
}
+void futex_set_nbuckets_param(struct bench_futex_parameters *params);
+void futex_print_nbuckets(struct bench_futex_parameters *params);
+
#endif /* _FUTEX_H */