/linux/tools/testing/selftests/futex/functional/ |
A D | futex_wait.c | 20 void *futex; variable 42 if (futex_wait(futex, 0, &to, flags)) in waiterfn() 56 futex = &f_private; in main() 80 info("Calling private futex_wait on futex: %p\n", futex); in main() 86 info("Calling private futex_wake on futex: %p\n", futex); in main() 87 res = futex_wake(futex, 1, FUTEX_PRIVATE_FLAG); in main() 106 futex = shared_data; in main() 108 info("Calling shared (page anon) futex_wait on futex: %p\n", futex); in main() 114 info("Calling shared (page anon) futex_wake on futex: %p\n", futex); in main() 115 res = futex_wake(futex, 1, 0); in main() [all …]
|
/linux/kernel/futex/ |
A D | .built-in.a.cmd | 1 …futex/built-in.a := echo >/dev/null; rm -f kernel/futex/built-in.a; /usr/bin/ccache /home/test/wor…
|
A D | waitwake.c | 678 restart->futex.uaddr = uaddr; in futex_wait() 679 restart->futex.val = val; in futex_wait() 680 restart->futex.time = *abs_time; in futex_wait() 681 restart->futex.bitset = bitset; in futex_wait() 682 restart->futex.flags = flags | FLAGS_HAS_TIMEOUT; in futex_wait() 696 u32 __user *uaddr = restart->futex.uaddr; in futex_wait_restart() 699 if (restart->futex.flags & FLAGS_HAS_TIMEOUT) { in futex_wait_restart() 700 t = restart->futex.time; in futex_wait_restart() 705 return (long)futex_wait(uaddr, restart->futex.flags, in futex_wait_restart() 706 restart->futex.val, tp, restart->futex.bitset); in futex_wait_restart()
|
A D | .pi.o.cmd | 1 …futex/pi.o := /usr/bin/ccache /home/test/workspace/code/optee_3.16/build/../toolchains/aarch64/bin… 3 source_kernel/futex/pi.o := kernel/futex/pi.c 5 deps_kernel/futex/pi.o := \ 738 kernel/futex/futex.h \ 741 include/linux/futex.h \ 742 include/uapi/linux/futex.h \ 744 arch/arm64/include/asm/futex.h \ 745 kernel/futex/../locking/rtmutex_common.h \ 747 kernel/futex/pi.o: $(deps_kernel/futex/pi.o) 749 $(deps_kernel/futex/pi.o):
|
A D | .requeue.o.cmd | 1 …futex/requeue.o := /usr/bin/ccache /home/test/workspace/code/optee_3.16/build/../toolchains/aarch6… 3 source_kernel/futex/requeue.o := kernel/futex/requeue.c 5 deps_kernel/futex/requeue.o := \ 747 kernel/futex/futex.h \ 750 include/linux/futex.h \ 751 include/uapi/linux/futex.h \ 753 arch/arm64/include/asm/futex.h \ 754 kernel/futex/../locking/rtmutex_common.h \ 756 kernel/futex/requeue.o: $(deps_kernel/futex/requeue.o) 758 $(deps_kernel/futex/requeue.o):
|
A D | .waitwake.o.cmd | 1 …futex/waitwake.o := /usr/bin/ccache /home/test/workspace/code/optee_3.16/build/../toolchains/aarch… 3 source_kernel/futex/waitwake.o := kernel/futex/waitwake.c 5 deps_kernel/futex/waitwake.o := \ 748 kernel/futex/futex.h \ 751 include/linux/futex.h \ 752 include/uapi/linux/futex.h \ 754 arch/arm64/include/asm/futex.h \ 756 kernel/futex/waitwake.o: $(deps_kernel/futex/waitwake.o) 758 $(deps_kernel/futex/waitwake.o):
|
A D | .core.o.cmd | 1 …futex/core.o := /usr/bin/ccache /home/test/workspace/code/optee_3.16/build/../toolchains/aarch64/b… 3 source_kernel/futex/core.o := kernel/futex/core.c 5 deps_kernel/futex/core.o := \ 1099 kernel/futex/futex.h \ 1100 include/linux/futex.h \ 1101 include/uapi/linux/futex.h \ 1103 arch/arm64/include/asm/futex.h \ 1104 kernel/futex/../locking/rtmutex_common.h \ 1106 kernel/futex/core.o: $(deps_kernel/futex/core.o) 1108 $(deps_kernel/futex/core.o):
|
/linux/tools/testing/selftests/futex/include/ |
A D | futextest.h | 70 #define futex(uaddr, op, val, timeout, uaddr2, val3, opflags) \ macro 80 return futex(uaddr, FUTEX_WAIT, val, timeout, NULL, 0, opflags); in futex_wait() 90 return futex(uaddr, FUTEX_WAKE, nr_wake, NULL, NULL, 0, opflags); in futex_wake() 101 return futex(uaddr, FUTEX_WAIT_BITSET, val, timeout, NULL, bitset, in futex_wait_bitset() 112 return futex(uaddr, FUTEX_WAKE_BITSET, nr_wake, NULL, NULL, bitset, in futex_wake_bitset() 124 return futex(uaddr, FUTEX_LOCK_PI, detect, timeout, NULL, 0, opflags); in futex_lock_pi() 133 return futex(uaddr, FUTEX_UNLOCK_PI, 0, NULL, NULL, 0, opflags); in futex_unlock_pi() 143 return futex(uaddr, FUTEX_WAKE_OP, nr_wake, nr_wake2, uaddr2, wake_op, in futex_wake_op() 159 return futex(uaddr, FUTEX_REQUEUE, nr_wake, nr_requeue, uaddr2, 0, in futex_requeue() 172 return futex(uaddr, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, uaddr2, in futex_cmp_requeue() [all …]
|
/linux/Documentation/locking/ |
A D | pi-futex.rst | 7 - in the user-space fastpath a PI-enabled futex involves no kernel work 64 locks (such as futex-based pthread mutexes) is priority inheritance: 80 normal futex-based locks: a 0 value means unlocked, and a value==TID 85 To handle the slowpath, we have added two new futex ops: 92 remaining work: if there is no futex-queue attached to the futex address 94 own TID into the futex value], and attaches a 'PI state' structure to 98 futex value. Then this task tries to lock the rt-mutex, on which it 101 perform - it now owns the lock, and futex value contains 114 there is no prior 'registration' of a PI-futex. [which is not quite 118 properties of futexes, and all four combinations are possible: futex, [all …]
|
A D | robust-futexes.rst | 15 A futex is in essence a user-space address, e.g. a 32-bit lock variable 20 creates a 'futex queue' internally, so that it can later on match up the 22 When the owner thread releases the futex, it notices (via the variable 25 taken and released the lock, the futex is again back to 'uncontended' 27 completely forgets that there ever was a futex at that address. This 44 the kernel cannot help with the cleanup: if there is no 'futex queue' 51 is needed to release that futex based lock. This is one of the leading 109 list is done after the futex is acquired by glibc, there is a few 191 If a futex is found to be held at exit time, the kernel sets the 192 following bit of the futex word:: [all …]
|
A D | index.rst | 21 pi-futex 22 futex-requeue-pi 26 robust-futex-ABI
|
A D | robust-futex-ABI.rst | 2 The robust futex ABI 26 waiting on a particular futex, and waking up the next waiter on a 27 particular futex. 80 lock variable used by the futex mechanism, in conjunction with 85 For each futex lock currently held by a thread, if it wants this 91 that lock using the futex mechanism. 118 existing futex mechanism to wait for, and wakeup, locks. The kernels 143 2) acquire the futex lock, 153 3) release the futex lock, and 162 1) if bit 31 (0x80000000) is set in that word, then attempt a futex [all …]
|
A D | futex-requeue-pi.rst | 5 Requeueing of tasks from a non-PI futex to a PI futex requires 56 user space already holding the PI futex. The glibc implementation 105 and pthread_cond_timedwait()) to block on the initial futex and wait 106 to be requeued to a PI-aware futex. The implementation is the 116 PI futex on behalf of the top waiter. If it can, this waiter is 118 nr_wake+nr_requeue tasks to the PI futex, calling
|
/linux/Documentation/userspace-api/ |
A D | futex2.rst | 9 futex, or fast user mutex, is a set of syscalls to allow userspace to create 14 futex2 is a followup version of the initial futex syscall, designed to overcome 37 and ``flags`` to specify the type (e.g. private) and size of futex. 59 - Some futex at the list was woken, returning the index of some waked futex. 61 An example of how to use the interface can be found at ``tools/testing/selftests/futex/functional/f… 71 Types of futex 74 A futex can be either private or shared. Private is used for processes that 75 shares the same memory space and the virtual address of the futex will be the 77 private futexes, it's necessary to specify ``FUTEX_PRIVATE_FLAG`` in the futex 79 have different virtual addresses for the same futex (using, for instance, a [all …]
|
/linux/tools/perf/bench/ |
A D | futex-lock-pi.c | 28 u_int32_t *futex; member 96 ret = futex_lock_pi(w->futex, NULL, futex_flag); in workerfn() 101 w->tid, w->futex, ret); in workerfn() 109 ret = futex_unlock_pi(w->futex, futex_flag); in workerfn() 112 w->tid, w->futex, ret); in workerfn() 132 worker[i].futex = calloc(1, sizeof(u_int32_t)); in create_threads() 133 if (!worker[i].futex) in create_threads() 136 worker[i].futex = &global_futex; in create_threads() 227 worker[i].tid, worker[i].futex, t); in bench_futex_lock_pi() 230 zfree(&worker[i].futex); in bench_futex_lock_pi()
|
A D | futex-hash.c | 44 u_int32_t *futex; member 91 ret = futex_wait(&w->futex[i], 1234, NULL, futex_flag); in workerfn() 175 worker[i].futex = calloc(params.nfutexes, sizeof(*worker[i].futex)); in bench_futex_hash() 176 if (!worker[i].futex) in bench_futex_hash() 221 worker[i].tid, &worker[i].futex[0], t); in bench_futex_hash() 224 worker[i].tid, &worker[i].futex[0], in bench_futex_hash() 225 &worker[i].futex[params.nfutexes-1], t); in bench_futex_hash() 228 zfree(&worker[i].futex); in bench_futex_hash()
|
A D | Build | 5 perf-y += futex-hash.o 6 perf-y += futex-wake.o 7 perf-y += futex-wake-parallel.o 8 perf-y += futex-requeue.o 9 perf-y += futex-lock-pi.o
|
A D | futex-wake-parallel.c | 48 static u_int32_t futex = 0; variable 85 waker->nwoken = futex_wake(&futex, nwakes, futex_flag); in waking_workerfn() 136 if (futex_wait(&futex, 0, NULL, futex_flag) != EINTR) in blocked_workerfn() 280 &futex, params.nwakes, nwakes); in bench_futex_wake_parallel()
|
/linux/kernel/ |
A D | built-in.a | 142 futex/core.o/ 143 futex/syscalls.o/ 144 futex/pi.o/ 145 futex/requeue.o/ 146 futex/waitwake.o/
|
/linux/tools/testing/selftests/powerpc/benchmarks/ |
A D | futex_bench.c | 18 #define futex(A, B, C, D, E, F) syscall(__NR_futex, A, B, C, D, E, F) macro 29 futex(&addr, FUTEX_WAKE, 1, NULL, NULL, 0); in test_futex()
|
/linux/tools/testing/selftests/futex/ |
A D | README | 3 Futex Test is intended to thoroughly test the Linux kernel futex system call 6 Functional tests shall test the documented behavior of the futex operation 54 based on the primary futex operation they test. Eventually this will become a
|
/linux/tools/perf/Documentation/ |
A D | perf-bench.txt | 61 'futex':: 206 SUITES FOR 'futex' 221 Suite for evaluating futex lock_pi calls.
|
/linux/tools/perf/scripts/python/bin/ |
A D | futex-contention-report | 4 perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/futex-contention.py
|
/linux/tools/testing/selftests/timens/ |
A D | .gitignore | 4 futex
|
A D | Makefile | 1 TEST_GEN_PROGS := timens timerfd timer clock_nanosleep procfs exec futex
|