]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf bench futex: Remove support for IMMUTABLE
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 10 Jul 2025 11:00:11 +0000 (13:00 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 11 Jul 2025 14:02:01 +0000 (16:02 +0200)
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
tools/include/uapi/linux/prctl.h
tools/perf/bench/futex-hash.c
tools/perf/bench/futex-lock-pi.c
tools/perf/bench/futex-requeue.c
tools/perf/bench/futex-wake-parallel.c
tools/perf/bench/futex-wake.c
tools/perf/bench/futex.c
tools/perf/bench/futex.h
tools/perf/trace/beauty/include/uapi/linux/prctl.h

index 43dec6eed559a68685fb03e659859bd2c4ee3395..3b93fb906e3c51a963e16f8fa60b072285d62473 100644 (file)
@@ -367,8 +367,6 @@ struct prctl_mm_map {
 /* FUTEX hash management */
 #define PR_FUTEX_HASH                  78
 # define PR_FUTEX_HASH_SET_SLOTS       1
-# define FH_FLAG_IMMUTABLE             (1ULL << 0)
 # define PR_FUTEX_HASH_GET_SLOTS       2
-# define PR_FUTEX_HASH_GET_IMMUTABLE   3
 
 #endif /* _LINUX_PRCTL_H */
index d2d6d7f3ea331c84a575a2eb550c65e79f339276..7e29f04da744900bdfea2b72458c28aeec46220c 100644 (file)
@@ -56,7 +56,6 @@ static struct bench_futex_parameters params = {
 
 static const struct option options[] = {
        OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
-       OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
        OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
        OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"),
        OPT_UINTEGER('f', "futexes", &params.nfutexes, "Specify amount of futexes per threads"),
index 5144a158512cc8bff1642932c63cf9ddbcb13ddf..40640b6744279153f4ac69fabc520d05f7f3c8c4 100644 (file)
@@ -47,7 +47,6 @@ static struct bench_futex_parameters params = {
 
 static const struct option options[] = {
        OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
-       OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
        OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
        OPT_UINTEGER('r', "runtime", &params.runtime, "Specify runtime (in seconds)"),
        OPT_BOOLEAN( 'M', "multi",   &params.multi, "Use multiple futexes"),
index a2f91ee1950b3482fef78341df92f0f2ee56fe2e..0748b0fd689e82393d54c9235b53f6bca522a16d 100644 (file)
@@ -52,7 +52,6 @@ static struct bench_futex_parameters params = {
 
 static const struct option options[] = {
        OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
-       OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
        OPT_UINTEGER('t', "threads",  &params.nthreads, "Specify amount of threads"),
        OPT_UINTEGER('q', "nrequeue", &params.nrequeue, "Specify amount of threads to requeue at once"),
        OPT_BOOLEAN( 's', "silent",   &params.silent, "Silent mode: do not display data/details"),
index ee66482c29fd1c930c4e12c7dc2b09cb5e3a03a9..6aede7c46b33759b965d6bbb0c7d92096ea31e8c 100644 (file)
@@ -63,7 +63,6 @@ static struct bench_futex_parameters params = {
 
 static const struct option options[] = {
        OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
-       OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
        OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
        OPT_UINTEGER('w', "nwakers", &params.nwakes, "Specify amount of waking threads"),
        OPT_BOOLEAN( 's', "silent",  &params.silent, "Silent mode: do not display data/details"),
index 8d6107f7cd941000cede1832c6694de483a89592..a31fc1563862e200cda0312a9e5e0b636097e53d 100644 (file)
@@ -52,7 +52,6 @@ static struct bench_futex_parameters params = {
 
 static const struct option options[] = {
        OPT_INTEGER( 'b', "buckets", &params.nbuckets, "Specify amount of hash buckets"),
-       OPT_BOOLEAN( 'I', "immutable", &params.buckets_immutable, "Make the hash buckets immutable"),
        OPT_UINTEGER('t', "threads", &params.nthreads, "Specify amount of threads"),
        OPT_UINTEGER('w', "nwakes",  &params.nwakes, "Specify amount of threads to wake at once"),
        OPT_BOOLEAN( 's', "silent",  &params.silent, "Silent mode: do not display data/details"),
index 4c4fee107e5912d5ac03a5d9c8894d511d1a2c77..1481196a22f0c089901c76560618ca742c70d992 100644 (file)
@@ -9,21 +9,17 @@
 #ifndef PR_FUTEX_HASH
 #define PR_FUTEX_HASH                   78
 # define PR_FUTEX_HASH_SET_SLOTS        1
-# define FH_FLAG_IMMUTABLE              (1ULL << 0)
 # define PR_FUTEX_HASH_GET_SLOTS        2
-# define PR_FUTEX_HASH_GET_IMMUTABLE    3
 #endif // PR_FUTEX_HASH
 
 void futex_set_nbuckets_param(struct bench_futex_parameters *params)
 {
-       unsigned long flags;
        int ret;
 
        if (params->nbuckets < 0)
                return;
 
-       flags = params->buckets_immutable ? FH_FLAG_IMMUTABLE : 0;
-       ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, params->nbuckets, flags);
+       ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, params->nbuckets, 0);
        if (ret) {
                printf("Requesting %d hash buckets failed: %d/%m\n",
                       params->nbuckets, ret);
@@ -47,18 +43,11 @@ void futex_print_nbuckets(struct bench_futex_parameters *params)
                        printf("Requested: %d in usage: %d\n", params->nbuckets, ret);
                        err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
                }
-               if (params->nbuckets == 0) {
+               if (params->nbuckets == 0)
                        ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
-               } else {
-                       ret = prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_IMMUTABLE);
-                       if (ret < 0) {
-                               printf("Can't check if the hash is immutable: %m\n");
-                               err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
-                       }
-                       ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets %s",
-                                      params->nbuckets,
-                                      ret == 1 ? "(immutable)" : "");
-               }
+               else
+                       ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets",
+                                      params->nbuckets);
        } else {
                if (ret <= 0) {
                        ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
index 9c9a73f9d865e71b15f0ded8ce174a9b8a9a2e93..dd295d27044ac40ca60cb181c746c8af5af1a703 100644 (file)
@@ -26,7 +26,6 @@ struct bench_futex_parameters {
        unsigned int nwakes;
        unsigned int nrequeue;
        int nbuckets;
-       bool buckets_immutable;
 };
 
 /**
index 43dec6eed559a68685fb03e659859bd2c4ee3395..3b93fb906e3c51a963e16f8fa60b072285d62473 100644 (file)
@@ -367,8 +367,6 @@ struct prctl_mm_map {
 /* FUTEX hash management */
 #define PR_FUTEX_HASH                  78
 # define PR_FUTEX_HASH_SET_SLOTS       1
-# define FH_FLAG_IMMUTABLE             (1ULL << 0)
 # define PR_FUTEX_HASH_GET_SLOTS       2
-# define PR_FUTEX_HASH_GET_IMMUTABLE   3
 
 #endif /* _LINUX_PRCTL_H */