| /tools/virtio/linux/ |
| A D | spinlock.h | 8 static inline void spin_lock_init(spinlock_t *lock) in spin_lock_init() argument 10 int r = pthread_spin_init(lock, 0); in spin_lock_init() 14 static inline void spin_lock(spinlock_t *lock) in spin_lock() argument 16 int ret = pthread_spin_lock(lock); in spin_lock() 22 int ret = pthread_spin_unlock(lock); in spin_unlock() 28 spin_lock(lock); in spin_lock_bh() 33 spin_unlock(lock); in spin_unlock_bh() 38 spin_lock(lock); in spin_lock_irq() 43 spin_unlock(lock); in spin_unlock_irq() 48 spin_lock(lock); in spin_lock_irqsave() [all …]
|
| /tools/testing/selftests/bpf/progs/ |
| A D | linked_list.c | 12 struct bpf_spin_lock lock; member 37 bpf_spin_lock(lock); in list_push_pop() 39 bpf_spin_unlock(lock); in list_push_pop() 46 bpf_spin_lock(lock); in list_push_pop() 48 bpf_spin_unlock(lock); in list_push_pop() 56 bpf_spin_lock(lock); in list_push_pop() 62 bpf_spin_lock(lock); in list_push_pop() 73 bpf_spin_lock(lock); in list_push_pop() 77 bpf_spin_lock(lock); in list_push_pop() 89 bpf_spin_lock(lock); in list_push_pop() [all …]
|
| A D | bpf_arena_spin_lock.h | 152 old = atomic_read(&lock->val); in xchg_tail() 180 WRITE_ONCE(lock->pending, 0); in clear_pending() 212 old = atomic_read(&lock->val); in arena_fetch_set_pending_acquire() 235 int val = atomic_read(&lock->val); in arena_spin_trylock() 288 clear_pending(lock); in arena_spin_lock_slowpath() 312 clear_pending_set_locked(lock); in arena_spin_lock_slowpath() 353 if (arena_spin_trylock(lock)) in arena_spin_lock_slowpath() 370 old = xchg_tail(lock, tail); in arena_spin_lock_slowpath() 438 set_locked(lock); in arena_spin_lock_slowpath() 520 smp_store_release(&lock->locked, 0); in arena_spin_unlock() [all …]
|
| A D | test_spin_lock_fail.c | 8 struct bpf_spin_lock lock; member 113 CHECK(kptr_kptr, &f1->lock, &f2->lock); 115 CHECK(kptr_mapval, &f1->lock, &v->lock); 116 CHECK(kptr_innermapval, &f1->lock, &iv->lock); 136 bpf_spin_lock(&f1->lock); in lock_id_mismatch_mapval_mapval() 143 CHECK(mapval_kptr, &v->lock, &f1->lock); 145 CHECK(mapval_innermapval, &v->lock, &iv->lock); 164 bpf_spin_lock(&f1->lock); in lock_id_mismatch_innermapval_innermapval1() 191 bpf_spin_lock(&f1->lock); in lock_id_mismatch_innermapval_innermapval2() 198 CHECK(innermapval_kptr, &iv->lock, &f1->lock); [all …]
|
| A D | refcounted_kptr.c | 87 bpf_spin_lock(lock); in __insert_in_tree_and_list() 90 bpf_spin_unlock(lock); in __insert_in_tree_and_list() 94 bpf_spin_unlock(lock); in __insert_in_tree_and_list() 96 bpf_spin_lock(lock); in __insert_in_tree_and_list() 99 bpf_spin_unlock(lock); in __insert_in_tree_and_list() 102 bpf_spin_unlock(lock); in __insert_in_tree_and_list() 130 bpf_spin_lock(lock); in __stash_map_insert_tree() 136 bpf_spin_unlock(lock); in __stash_map_insert_tree() 148 bpf_spin_lock(lock); in __read_from_tree() 165 bpf_spin_unlock(lock); in __read_from_tree() [all …]
|
| A D | stream.c | 10 struct bpf_res_spin_lock lock; member 52 struct bpf_res_spin_lock *lock, *nlock; in stream_deadlock() local 54 lock = bpf_map_lookup_elem(&arrmap, &(int){0}); in stream_deadlock() 55 if (!lock) in stream_deadlock() 60 if (bpf_res_spin_lock(lock)) in stream_deadlock() 63 bpf_res_spin_unlock(lock); in stream_deadlock() 67 bpf_res_spin_unlock(lock); in stream_deadlock()
|
| A D | res_spin_lock_fail.c | 11 struct bpf_res_spin_lock lock; member 36 bpf_res_spin_lock(&elem->lock); in res_spin_lock_arg() 49 bpf_res_spin_lock(&elem->lock); in res_spin_lock_AA() 50 bpf_res_spin_lock(&elem->lock); in res_spin_lock_AA() 63 if (bpf_res_spin_lock(&elem->lock)) in res_spin_lock_cond_AA() 65 bpf_res_spin_lock(&elem->lock); in res_spin_lock_cond_AA() 78 if (bpf_res_spin_lock(&elem->lock)) in res_spin_lock_mismatch_1() 95 bpf_res_spin_unlock(&elem->lock); in res_spin_lock_mismatch_2() 143 if (bpf_res_spin_lock(&elem->lock)) { in res_spin_lock_ooo() 147 bpf_res_spin_unlock(&elem->lock); in res_spin_lock_ooo() [all …]
|
| A D | test_helper_restricted.c | 10 struct lock { struct 25 __type(value, struct lock); 50 struct lock *lock; in spin_lock_work() local 52 lock = bpf_map_lookup_elem(&locks, &key); in spin_lock_work() 53 if (lock) { in spin_lock_work() 54 bpf_spin_lock(&lock->l); in spin_lock_work() 55 bpf_spin_unlock(&lock->l); in spin_lock_work()
|
| A D | test_map_lock.c | 10 struct bpf_spin_lock lock; member 22 struct bpf_spin_lock lock; member 45 bpf_spin_lock(&val->lock); in bpf_map_lock_test() 48 bpf_spin_unlock(&val->lock); in bpf_map_lock_test() 54 bpf_spin_lock(&q->lock); in bpf_map_lock_test() 57 bpf_spin_unlock(&q->lock); in bpf_map_lock_test()
|
| A D | linked_list_fail.c | 124 CHECK(inner_map_map, op, &iv->lock, &v->head); 153 CHECK(map_map, op, &v->lock, &v2->head, &f->node2); \ 154 CHECK(map_kptr, op, &v->lock, &f2->head, &b->node); \ 155 CHECK(map_global, op, &v->lock, &ghead, &f->node2); \ 295 return *(int *)&f->lock; in direct_read_lock() 306 *(int *)&f->lock = 0; in direct_write_lock() 555 bpf_spin_lock(&f->lock); in incorrect_head_off1() 557 bpf_spin_unlock(&f->lock); in incorrect_head_off1() 583 struct bpf_spin_lock lock; in pop_ptr_off() member 590 bpf_spin_lock(&p->lock); in pop_ptr_off() [all …]
|
| A D | res_spin_lock.c | 12 struct bpf_res_spin_lock lock; member 38 r = bpf_res_spin_lock(&elem1->lock); in res_spin_lock_test() 41 r = bpf_res_spin_lock(&elem2->lock); in res_spin_lock_test() 43 bpf_res_spin_unlock(&elem2->lock); in res_spin_lock_test() 44 bpf_res_spin_unlock(&elem1->lock); in res_spin_lock_test() 47 bpf_res_spin_unlock(&elem1->lock); in res_spin_lock_test() 104 locks[i] = &e->lock; in res_spin_lock_test_held_lock_max() 116 locks[i] = &e->lock; in res_spin_lock_test_held_lock_max()
|
| A D | test_spin_lock.c | 10 struct bpf_spin_lock lock; member 22 struct bpf_spin_lock lock; member 33 struct bpf_spin_lock lock; member 70 bpf_spin_lock(&val->lock); in bpf_spin_lock_test() 77 bpf_spin_unlock(&val->lock); in bpf_spin_lock_test() 84 bpf_spin_lock(&q->lock); in bpf_spin_lock_test() 91 bpf_spin_unlock(&q->lock); in bpf_spin_lock_test() 97 bpf_spin_lock(&cls->lock); in bpf_spin_lock_test() 99 bpf_spin_unlock(&cls->lock); in bpf_spin_lock_test()
|
| /tools/perf/tests/shell/ |
| A D | lock_contention.sh | 61 if ! perf lock con -b true > /dev/null 2>&1 ; then 79 perf lock contention -i- -E 1 -q 2> ${result} 97 if ! perf lock con -b true > /dev/null 2>&1 ; then 120 if ! perf lock con -b true > /dev/null 2>&1 ; then 137 if ! perf lock con -b true > /dev/null 2>&1 ; then 161 if ! perf lock con -b true > /dev/null 2>&1 ; then 193 if ! perf lock con -b true > /dev/null 2>&1 ; then 221 if ! perf lock con -b true > /dev/null 2>&1 ; then 249 if ! perf lock con -b true > /dev/null 2>&1 ; then 264 if ! perf lock con -b true > /dev/null 2>&1 ; then [all …]
|
| /tools/virtio/ringtest/ |
| A D | ptr_ring.c | 66 int r = pthread_spin_init(lock, 0); in spin_lock_init() 70 static void spin_lock(spinlock_t *lock) in spin_lock() argument 72 int ret = pthread_spin_lock(lock); in spin_lock() 76 static void spin_unlock(spinlock_t *lock) in spin_unlock() argument 78 int ret = pthread_spin_unlock(lock); in spin_unlock() 84 spin_lock(lock); in spin_lock_bh() 89 spin_unlock(lock); in spin_unlock_bh() 94 spin_lock(lock); in spin_lock_irq() 99 spin_unlock(lock); in spin_unlock_irq() 104 spin_lock(lock); in spin_lock_irqsave() [all …]
|
| /tools/perf/Documentation/ |
| A D | perf-lock.txt | 1 perf-lock(1) 6 perf-lock - Analyze lock events 18 'perf lock record <command>' records lock events 21 results of lock events. 25 'perf lock script' shows raw lock events. 28 of lock instances. 177 --lock-addr:: 181 --lock-owner:: 188 Show lock contention only for given lock types (comma separated list). 198 --lock-filter=<value>:: [all …]
|
| /tools/include/linux/ |
| A D | rwsem.h | 8 pthread_rwlock_t lock; member 13 return pthread_rwlock_init(&sem->lock, NULL); in init_rwsem() 18 return pthread_rwlock_destroy(&sem->lock); in exit_rwsem() 23 return pthread_rwlock_rdlock(&sem->lock); in down_read() 28 return pthread_rwlock_unlock(&sem->lock); in up_read() 33 return pthread_rwlock_wrlock(&sem->lock); in down_write() 38 return pthread_rwlock_unlock(&sem->lock); in up_write()
|
| /tools/testing/selftests/futex/functional/ |
| A D | futex_numa.c | 36 void futex_numa_32_lock(struct futex_numa_32 *lock) in futex_numa_32_lock() argument 63 if (__atomic_compare_exchange_n(&lock->full, in futex_numa_32_lock() 78 futex2_wait(lock, new.val, fflags, NULL, 0); in futex_numa_32_lock() 87 int woken = futex2_wake(lock, 1, fflags); in futex_numa_32_unlock() 102 struct futex_numa_32 *lock; member 118 futex_numa_32_lock(args->lock); in threadfn() 126 node = args->lock->node; in threadfn() 127 futex_numa_32_unlock(args->lock); in threadfn() 158 static struct futex_numa_32 lock = { .val = 0, }; variable 201 args->lock = &lock; in main() [all …]
|
| /tools/perf/util/ |
| A D | threads.c | 29 init_rwsem(&table->lock); in threads__init() 41 exit_rwsem(&table->lock); in threads__exit() 52 down_read(&table->lock); in threads__nr() 54 up_read(&table->lock); in threads__nr() 87 down_write(&table->lock); in threads_table_entry__set_last_match() 89 up_write(&table->lock); in threads_table_entry__set_last_match() 97 down_read(&table->lock); in threads__find() 103 up_read(&table->lock); in threads__find() 131 up_write(&table->lock); in threads__findnew() 165 up_write(&table->lock); in threads__remove() [all …]
|
| A D | rwsem.c | 15 return pthread_rwlock_init(&sem->lock, NULL); in init_rwsem() 25 return pthread_rwlock_destroy(&sem->lock); in exit_rwsem() 36 return perf_singlethreaded ? 0 : pthread_rwlock_rdlock(&sem->lock); in down_read() 47 return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); in up_read() 58 return perf_singlethreaded ? 0 : pthread_rwlock_wrlock(&sem->lock); in down_write() 69 return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); in up_write()
|
| A D | dsos.c | 17 init_rwsem(&dsos->lock); in dsos__init() 27 down_write(&dsos->lock); in dsos__purge() 41 up_write(&dsos->lock); in dsos__purge() 47 exit_rwsem(&dsos->lock); in dsos__exit() 176 up_read(&dsos->lock); in __dsos__find_by_longname_id() 243 up_write(&dsos->lock); in dsos__add() 289 down_read(&dsos->lock); in dsos__find() 291 up_read(&dsos->lock); in dsos__find() 359 up_write(&dsos->lock); in dsos__findnew_id() 462 up_write(&dsos->lock); in dsos__findnew_module_dso() [all …]
|
| /tools/testing/selftests/kvm/lib/arm64/ |
| A D | spinlock.c | 9 void spin_lock(struct spinlock *lock) in spin_lock() argument 20 : "r" (&lock->v) in spin_lock() 24 void spin_unlock(struct spinlock *lock) in spin_unlock() argument 26 asm volatile("stlr wzr, [%0]\n" : : "r" (&lock->v) : "memory"); in spin_unlock()
|
| /tools/testing/selftests/timens/ |
| A D | clock_nanosleep.c | 27 pthread_mutex_t *lock; member 37 pthread_mutex_unlock(args->lock); in call_nanosleep() 46 pthread_mutex_t lock; in run_test() local 53 pthread_mutex_init(&lock, NULL); in run_test() 54 pthread_mutex_lock(&lock); in run_test() 70 args.lock = &lock; in run_test() 88 if (pthread_mutex_trylock(&lock) == 0) { in run_test() 97 pthread_mutex_destroy(&lock); in run_test()
|
| /tools/testing/radix-tree/ |
| A D | regression1.c | 49 pthread_mutex_t lock; member 61 pthread_mutex_init(&p->lock, NULL); in page_alloc() 70 pthread_mutex_destroy(&p->lock); in page_rcu_free() 91 pthread_mutex_lock(&page->lock); in find_get_pages() 96 pthread_mutex_unlock(&page->lock); in find_get_pages() 106 pthread_mutex_unlock(&page->lock); in find_get_pages() 139 pthread_mutex_lock(&p->lock); in regression1_fn() 141 pthread_mutex_unlock(&p->lock); in regression1_fn() 147 pthread_mutex_lock(&p->lock); in regression1_fn() 149 pthread_mutex_unlock(&p->lock); in regression1_fn()
|
| /tools/arch/x86/include/asm/ |
| A D | cmpxchg.h | 35 #define __raw_cmpxchg(ptr, old, new, size, lock) \ argument 44 asm volatile(lock "cmpxchgb %2,%1" \ 53 asm volatile(lock "cmpxchgw %2,%1" \ 62 asm volatile(lock "cmpxchgl %2,%1" \ 71 asm volatile(lock "cmpxchgq %2,%1" \
|
| /tools/testing/shared/ |
| A D | linux.c | 20 pthread_mutex_t lock; member 89 pthread_mutex_lock(&cachep->lock); in kmem_cache_alloc_lru() 94 pthread_mutex_unlock(&cachep->lock); in kmem_cache_alloc_lru() 98 pthread_mutex_unlock(&cachep->lock); in kmem_cache_alloc_lru() 145 pthread_mutex_lock(&cachep->lock); in kmem_cache_free() 147 pthread_mutex_unlock(&cachep->lock); in kmem_cache_free() 155 pthread_mutex_lock(&cachep->lock); in kmem_cache_free_bulk() 158 pthread_mutex_unlock(&cachep->lock); in kmem_cache_free_bulk() 173 pthread_mutex_lock(&cachep->lock); in kmem_cache_alloc_bulk() 190 pthread_mutex_unlock(&cachep->lock); in kmem_cache_alloc_bulk() [all …]
|