| /linux/Documentation/translations/zh_CN/userspace-api/ |
| H A D | futex2.rst | 16 futex,或者称为快速用户互斥锁(fast user mutex),是一组允许用户空间创建高性能同步 20 futex2是初代futex系统调用的后续版本,旨在克服原有接口的限制。 28 等待一个futex数组,可由其中任意一个唤醒:: 41 地址, ``val`` 为期望值, ``flags`` 为指定的类型(如private)和futex的大小。 58 - 某个列表中的futex被唤醒,返回那个被唤醒的futex的索引。 60 关于如何使用接口的例子可以在 ``tools/testing/selftests/futex/functional/futex_waitv.c`` 70 futex的类型 73 futex既可以是私有的也可以是共享的。私有用于多个进程共享同样的内存空间,并且futex的虚拟 74 地址对所有进程都是一样的。这允许在内核中进行优化。要使用私有futex,需要在futex标志中指定 75 ``FUTEX_PRIVATE_FLAG`` 。对于那些不在同一内存空间共享的进程,可以让同一个futex拥有不同 [all …]
|
| /linux/tools/testing/selftests/futex/functional/ |
| H A D | futex_wait.c | 5 * futex cmp requeue test by André Almeida <andrealmeid@collabora.com> 21 void *futex; 38 res = futex_wait(futex, 0, &to, args->flags); 57 futex = &f_private; in TEST() 59 /* Testing a private futex */ in TEST() 60 TH_LOG("Calling private futex_wait on futex: %p", futex); in TEST() 66 TH_LOG("Calling private futex_wake on futex: %p", futex); in TEST() 67 res = futex_wake(futex, in TEST() 20 void *futex; global() variable [all...] |
| H A D | robust_list.c | 16 * thread waiting for each futex and marking the futex word with the flag 21 * Documententation/locking/robust-futex-ABI.rst 71 * Basic lock struct, contains just the futex word and the robust list element in create_child() 77 atomic_futex_t futex; in create_child() 129 head->futex_offset = (size_t) offsetof(struct lock_struct, futex) - in mutex_lock() 142 atomic_futex_t *futex = &lock->futex; in mutex_lock() 153 if (atomic_compare_exchange_strong(futex, &zero, tid)) { in mutex_lock() 179 tid = atomic_load(futex); in child_fn_lock() [all...] |
| H A D | futex_numa_mpol.c | 19 #include <linux/futex.h> 160 futex_numa->futex = 0; in TEST() 167 /* FUTEX2_NUMA futex must be 8-byte aligned */ in TEST() 168 TH_LOG("Mis-aligned futex"); in TEST() 202 futex_numa->futex = 0; in TEST()
|
| /linux/kernel/futex/ |
| H A D | core.c | 6 * Generalized futexes, futex requeueing, misc fixes by Ingo Molnar 12 * Robust futex support started by Ingo Molnar 16 * PI-futex support started by Ingo Molnar and Thomas Gleixner 51 #include <vdso/futex.h> 55 #include "futex.h" 201 struct futex_mm_phash *mmph = &mm->futex.phash; in __futex_pivot_hash() 226 scoped_guard(mutex, &mm->futex.phash.lock) { in futex_pivot_hash() 229 fph = mm->futex.phash.hash_new; in futex_pivot_hash() 231 mm->futex.phash.hash_new = NULL; in futex_pivot_hash() 253 fph = rcu_dereference(mm->futex in futex_private_hash() [all...] |
| /linux/tools/testing/selftests/futex/include/ |
| H A D | futextest.h | 7 * Glibc independent futex library for testing kernel functionality. 23 #include <linux/futex.h> 70 * however, the SYS_futex will still point to the 32bit futex system call. 79 * futex() - SYS_futex syscall wrapper 80 * @uaddr: address of first futex 81 * @op: futex op code 85 * @uaddr2: address of second futex for some ops\ 89 * futex() is used by all the following futex op wrappers. It can also be 98 #define futex(uadd 92 #define futex( global() macro [all...] |
| H A D | futex2test.h | 3 * Futex2 library addons for futex tests 57 futex_t futex; 55 futex_t futex; global() member
|
| /linux/Documentation/locking/ |
| H 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 93 yet then the code looks up the task that owns the futex [it has put its 94 own TID into the futex value], and attaches a 'PI state' structure to 95 the futex-queue. The pi_state includes an rt-mutex, which is a PI-aware, 98 futex value. Then this task tries to lock the rt-mutex, on which it 100 futex value to its own TID and returns. Userspace has no other work to [all …]
|
| H 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/tools/perf/bench/ |
| H A D | futex-lock-pi.c | 29 u_int32_t *futex; member 100 ret = futex_lock_pi(w->futex, NULL, futex_flag); in workerfn() 105 w->tid, w->futex, ret); in workerfn() 113 ret = futex_unlock_pi(w->futex, futex_flag); in workerfn() 116 w->tid, w->futex, ret); in workerfn() 144 worker[i].futex = calloc(1, sizeof(u_int32_t)); in create_threads() 145 if (!worker[i].futex) in create_threads() 148 worker[i].futex = &global_futex; in create_threads() 243 worker[i].tid, worker[i].futex, t); in bench_futex_lock_pi() 246 zfree(&worker[i].futex); in bench_futex_lock_pi()
|
| H A D | futex-hash.c | 46 u_int32_t *futex; member 95 ret = futex_wait(&w->futex[i], 1234, NULL, futex_flag); in workerfn() 189 worker[i].futex = calloc(params.nfutexes, sizeof(*worker[i].futex)); in bench_futex_hash() 190 if (!worker[i].futex) in bench_futex_hash() 239 worker[i].tid, &worker[i].futex[0], t); in bench_futex_hash() 242 worker[i].tid, &worker[i].futex[0], in bench_futex_hash() 243 &worker[i].futex[params.nfutexes-1], t); in bench_futex_hash() 246 zfree(&worker[i].futex); in bench_futex_hash()
|
| H A D | Build | 6 perf-bench-y += futex.o 7 perf-bench-y += futex-hash.o 8 perf-bench-y += futex-wake.o 9 perf-bench-y += futex-wake-parallel.o 10 perf-bench-y += futex-requeue.o 11 perf-bench-y += futex-lock-pi.o
|
| H A D | futex-wake-parallel.c | 49 static u_int32_t futex = 0; variable 89 waker->nwoken = futex_wake(&futex, nwakes, futex_flag); in waking_workerfn() 143 if (futex_wait(&futex, 0, NULL, futex_flag) != EINTR) in blocked_workerfn() 303 &futex, params.nwakes, nwakes); in bench_futex_wake_parallel()
|
| /linux/Documentation/userspace-api/ |
| H 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/Documentation/translations/zh_CN/locking/ |
| H A D | index.rst | 31 * pi-futex 32 * futex-requeue-pi 36 * robust-futex-ABI
|
| /linux/tools/sched_ext/ |
| H A D | Kconfig | 19 # LAVD tracks futex to give an additional time slice for futex holder 21 # LAVD first tries to use ftrace to trace futex function calls.
|
| /linux/tools/testing/selftests/powerpc/benchmarks/ |
| H 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/ |
| H 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/scripts/python/bin/ |
| H A D | futex-contention-report | 4 perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/futex-contention.py
|
| /linux/tools/testing/selftests/timens/ |
| H A D | .gitignore | 4 futex
|
| H A D | Makefile | 1 TEST_GEN_PROGS := timens timerfd timer clock_nanosleep procfs exec futex vfork_exec
|
| /linux/arch/um/os-Linux/skas/ |
| H A D | process.c | 190 data->futex = FUTEX_IN_CHILD; in wait_stub_done_seccomp() 191 CATCH_EINTR(syscall(__NR_futex, &data->futex, in wait_stub_done_seccomp() 210 ret = syscall(__NR_futex, &data->futex, in wait_stub_done_seccomp() 218 } while (data->futex == FUTEX_IN_CHILD); in wait_stub_done_seccomp() 475 proc_data->futex = FUTEX_IN_CHILD; in start_userspace()
|
| /linux/arch/um/include/shared/skas/ |
| H A D | stub-data.h | 64 unsigned int futex; member
|
| /linux/tools/perf/Documentation/ |
| H A D | perf-bench.txt | 61 'futex':: 286 SUITES FOR 'futex' 301 Suite for evaluating futex lock_pi calls.
|
| /linux/tools/perf/arch/powerpc/entry/syscalls/ |
| H A D | syscall.tbl | 281 221 32 futex sys_futex_time32 282 221 64 futex sys_futex 283 221 spu futex sys_futex
|