Skip to content

Commit 7497e94

Browse files
Sebastian Andrzej SiewiorPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 16adc7f commit 7497e94

File tree

9 files changed

+5
-26
lines changed

9 files changed

+5
-26
lines changed

tools/include/uapi/linux/prctl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,6 @@ struct prctl_mm_map {
367367
/* FUTEX hash management */
368368
#define PR_FUTEX_HASH 78
369369
# define PR_FUTEX_HASH_SET_SLOTS 1
370-
# define FH_FLAG_IMMUTABLE (1ULL << 0)
371370
# define PR_FUTEX_HASH_GET_SLOTS 2
372-
# define PR_FUTEX_HASH_GET_IMMUTABLE 3
373371

374372
#endif /* _LINUX_PRCTL_H */

tools/perf/bench/futex-hash.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static struct bench_futex_parameters params = {
5656

5757
static const struct option options[] = {
5858
OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
59-
OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
6059
OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
6160
OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"),
6261
OPT_UINTEGER('f', "futexes", &params.nfutexes, "Specify amount of futexes per threads"),

tools/perf/bench/futex-lock-pi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static struct bench_futex_parameters params = {
4747

4848
static const struct option options[] = {
4949
OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
50-
OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
5150
OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
5251
OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"),
5352
OPT_BOOLEAN( 'M', "multi", &params.multi, "Use multiple futexes"),

tools/perf/bench/futex-requeue.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static struct bench_futex_parameters params = {
5252

5353
static const struct option options[] = {
5454
OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
55-
OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
5655
OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
5756
OPT_UINTEGER('q', "nrequeue", &params.nrequeue, "Specify amount of threads to requeue at once"),
5857
OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),

tools/perf/bench/futex-wake-parallel.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static struct bench_futex_parameters params = {
6363

6464
static const struct option options[] = {
6565
OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
66-
OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
6766
OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
6867
OPT_UINTEGER('w', "nwakers", &params.nwakes, "Specify amount of waking threads"),
6968
OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),

tools/perf/bench/futex-wake.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static struct bench_futex_parameters params = {
5252

5353
static const struct option options[] = {
5454
OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
55-
OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
5655
OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
5756
OPT_UINTEGER('w', "nwakes", &params.nwakes, "Specify amount of threads to wake at once"),
5857
OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),

tools/perf/bench/futex.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,17 @@
99
#ifndef PR_FUTEX_HASH
1010
#define PR_FUTEX_HASH 78
1111
# define PR_FUTEX_HASH_SET_SLOTS 1
12-
# define FH_FLAG_IMMUTABLE (1ULL << 0)
1312
# define PR_FUTEX_HASH_GET_SLOTS 2
14-
# define PR_FUTEX_HASH_GET_IMMUTABLE 3
1513
#endif // PR_FUTEX_HASH
1614

1715
void futex_set_nbuckets_param(struct bench_futex_parameters *params)
1816
{
19-
unsigned long flags;
2017
int ret;
2118

2219
if (params->nbuckets < 0)
2320
return;
2421

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);
2723
if (ret) {
2824
printf("Requesting %d hash buckets failed: %d/%m\n",
2925
params->nbuckets, ret);
@@ -47,18 +43,11 @@ void futex_print_nbuckets(struct bench_futex_parameters *params)
4743
printf("Requested: %d in usage: %d\n", params->nbuckets, ret);
4844
err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
4945
}
50-
if (params->nbuckets == 0) {
46+
if (params->nbuckets == 0)
5147
ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
52-
} else {
53-
ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_IMMUTABLE);
54-
if (ret < 0) {
55-
printf("Can't check if the hash is immutable: %m\n");
56-
err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
57-
}
58-
ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets %s",
59-
params->nbuckets,
60-
ret == 1 ? "(immutable)" : "");
61-
}
48+
else
49+
ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets",
50+
params->nbuckets);
6251
} else {
6352
if (ret <= 0) {
6453
ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");

tools/perf/bench/futex.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct bench_futex_parameters {
2626
unsigned int nwakes;
2727
unsigned int nrequeue;
2828
int nbuckets;
29-
bool buckets_immutable;
3029
};
3130

3231
/**

tools/perf/trace/beauty/include/uapi/linux/prctl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,6 @@ struct prctl_mm_map {
367367
/* FUTEX hash management */
368368
#define PR_FUTEX_HASH 78
369369
# define PR_FUTEX_HASH_SET_SLOTS 1
370-
# define FH_FLAG_IMMUTABLE (1ULL << 0)
371370
# define PR_FUTEX_HASH_GET_SLOTS 2
372-
# define PR_FUTEX_HASH_GET_IMMUTABLE 3
373371

374372
#endif /* _LINUX_PRCTL_H */

0 commit comments

Comments
 (0)