Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf bench futex: Remove support for IMMUTABLE

It has been decided to remove the support IMMUTABLE futex.
perf bench was one of the eary users for testing purposes. Now that the
API is removed before it could be used in an official release, remove
the bits from perf, too.

Remove Remove support for IMMUTABLE futex.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250710110011.384614-7-bigeasy@linutronix.de

authored by

Sebastian Andrzej Siewior and committed by
Peter Zijlstra
7497e947 16adc7f1

+5 -26
-2
tools/include/uapi/linux/prctl.h
··· 367 367 /* FUTEX hash management */ 368 368 #define PR_FUTEX_HASH 78 369 369 # define PR_FUTEX_HASH_SET_SLOTS 1 370 - # define FH_FLAG_IMMUTABLE (1ULL << 0) 371 370 # define PR_FUTEX_HASH_GET_SLOTS 2 372 - # define PR_FUTEX_HASH_GET_IMMUTABLE 3 373 371 374 372 #endif /* _LINUX_PRCTL_H */
-1
tools/perf/bench/futex-hash.c
··· 56 56 57 57 static const struct option options[] = { 58 58 OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"), 59 - OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"), 60 59 OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"), 61 60 OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"), 62 61 OPT_UINTEGER('f', "futexes", &params.nfutexes, "Specify amount of futexes per threads"),
-1
tools/perf/bench/futex-lock-pi.c
··· 47 47 48 48 static const struct option options[] = { 49 49 OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"), 50 - OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"), 51 50 OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"), 52 51 OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"), 53 52 OPT_BOOLEAN( 'M', "multi", &params.multi, "Use multiple futexes"),
-1
tools/perf/bench/futex-requeue.c
··· 52 52 53 53 static const struct option options[] = { 54 54 OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"), 55 - OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"), 56 55 OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"), 57 56 OPT_UINTEGER('q', "nrequeue", &params.nrequeue, "Specify amount of threads to requeue at once"), 58 57 OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),
-1
tools/perf/bench/futex-wake-parallel.c
··· 63 63 64 64 static const struct option options[] = { 65 65 OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"), 66 - OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"), 67 66 OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"), 68 67 OPT_UINTEGER('w', "nwakers", &params.nwakes, "Specify amount of waking threads"), 69 68 OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),
-1
tools/perf/bench/futex-wake.c
··· 52 52 53 53 static const struct option options[] = { 54 54 OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"), 55 - OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"), 56 55 OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"), 57 56 OPT_UINTEGER('w', "nwakes", &params.nwakes, "Specify amount of threads to wake at once"), 58 57 OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),
+5 -16
tools/perf/bench/futex.c
··· 9 9 #ifndef PR_FUTEX_HASH 10 10 #define PR_FUTEX_HASH 78 11 11 # define PR_FUTEX_HASH_SET_SLOTS 1 12 - # define FH_FLAG_IMMUTABLE (1ULL << 0) 13 12 # define PR_FUTEX_HASH_GET_SLOTS 2 14 - # define PR_FUTEX_HASH_GET_IMMUTABLE 3 15 13 #endif // PR_FUTEX_HASH 16 14 17 15 void futex_set_nbuckets_param(struct bench_futex_parameters *params) 18 16 { 19 - unsigned long flags; 20 17 int ret; 21 18 22 19 if (params->nbuckets < 0) 23 20 return; 24 21 25 - flags = params->buckets_immutable ? FH_FLAG_IMMUTABLE : 0; 26 - ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, params->nbuckets, flags); 22 + ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, params->nbuckets, 0); 27 23 if (ret) { 28 24 printf("Requesting %d hash buckets failed: %d/%m\n", 29 25 params->nbuckets, ret); ··· 43 47 printf("Requested: %d in usage: %d\n", params->nbuckets, ret); 44 48 err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)"); 45 49 } 46 - if (params->nbuckets == 0) { 50 + if (params->nbuckets == 0) 47 51 ret = asprintf(&futex_hash_mode, "Futex hashing: global hash"); 48 - } else { 49 - ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_IMMUTABLE); 50 - if (ret < 0) { 51 - printf("Can't check if the hash is immutable: %m\n"); 52 - err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)"); 53 - } 54 - ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets %s", 55 - params->nbuckets, 56 - ret == 1 ? "(immutable)" : ""); 57 - } 52 + else 53 + ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets", 54 + params->nbuckets); 58 55 } else { 59 56 if (ret <= 0) { 60 57 ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
-1
tools/perf/bench/futex.h
··· 26 26 unsigned int nwakes; 27 27 unsigned int nrequeue; 28 28 int nbuckets; 29 - bool buckets_immutable; 30 29 }; 31 30 32 31 /**
-2
tools/perf/trace/beauty/include/uapi/linux/prctl.h
··· 367 367 /* FUTEX hash management */ 368 368 #define PR_FUTEX_HASH 78 369 369 # define PR_FUTEX_HASH_SET_SLOTS 1 370 - # define FH_FLAG_IMMUTABLE (1ULL << 0) 371 370 # define PR_FUTEX_HASH_GET_SLOTS 2 372 - # define PR_FUTEX_HASH_GET_IMMUTABLE 3 373 371 374 372 #endif /* _LINUX_PRCTL_H */