/openbmc/linux/include/linux/ |
H A D | lockdep.h | 233 lockdep_init_map_type(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\ 239 lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock) 244 #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) argument 249 return lock->key == key; in lockdep_match_key() 291 #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map) argument 292 #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r)) argument 304 lock_set_class(lock, lock->name, lock->key, subclass, ip); in lock_set_subclass() 483 lock(_lock); \ 493 ____err = lock(_lock); \ 506 lock(_lock) [all …]
|
H A D | seqlock.h | 183 #define seqcount_spinlock_init(s, lock) seqcount_LOCKNAME_init(s, lock, spinlock) argument 184 #define seqcount_rwlock_init(s, lock) seqcount_LOCKNAME_init(s, lock, rwlock) argument 185 #define seqcount_mutex_init(s, lock) seqcount_LOCKNAME_init(s, lock, mutex) argument 290 #define SEQCNT_RAW_SPINLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 291 #define SEQCNT_SPINLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 292 #define SEQCNT_RWLOCK_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 293 #define SEQCNT_MUTEX_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 294 #define SEQCNT_WW_MUTEX_ZERO(name, lock) SEQCOUNT_LOCKNAME_ZERO(name, lock) argument 803 spinlock_t lock; member 887 spin_lock(&sl->lock); in write_seqlock() [all …]
|
H A D | local_lock.h | 10 #define local_lock_init(lock) __local_lock_init(lock) argument 16 #define local_lock(lock) __local_lock(lock) argument 22 #define local_lock_irq(lock) __local_lock_irq(lock) argument 30 #define local_lock_irqsave(lock, flags) \ argument 31 __local_lock_irqsave(lock, flags) 37 #define local_unlock(lock) __local_unlock(lock) argument 43 #define local_unlock_irq(lock) __local_unlock_irq(lock) argument 51 #define local_unlock_irqrestore(lock, flags) \ argument 52 __local_unlock_irqrestore(lock, flags)
|
/openbmc/linux/include/trace/events/ |
H A D | lock.h | 3 #define TRACE_SYSTEM lock 34 __string(name, lock->name) 50 DECLARE_EVENT_CLASS(lock, 54 TP_ARGS(lock, ip), 73 TP_ARGS(lock, ip) 82 TP_ARGS(lock, ip) 89 TP_ARGS(lock, ip) 99 TP_ARGS(lock, flags), 107 __entry->lock_addr = lock; 126 TP_ARGS(lock, ret), [all …]
|
/openbmc/linux/kernel/locking/ |
H A D | qspinlock_paravirt.h | 111 WRITE_ONCE(lock->pending, 1); in set_pending() 172 struct qspinlock *lock; member 220 if (!cmpxchg(&he->lock, NULL, lock)) { in pv_hash() 223 return &he->lock; in pv_hash() 246 if (READ_ONCE(he->lock) == lock) { in pv_unhash() 392 (void)pv_hash(lock, pn); in pv_kick_node() 433 set_pending(lock); in pv_wait_head_or_lock() 439 clear_pending(lock); in pv_wait_head_or_lock() 443 lp = pv_hash(lock, pn); in pv_wait_head_or_lock() 510 (unsigned long)lock, atomic_read(&lock->val)); in __pv_queued_spin_unlock_slowpath() [all …]
|
H A D | qrwlock.c | 36 atomic_sub(_QR_BIAS, &lock->cnts); in queued_read_lock_slowpath() 38 trace_contention_begin(lock, LCB_F_SPIN | LCB_F_READ); in queued_read_lock_slowpath() 43 arch_spin_lock(&lock->wait_lock); in queued_read_lock_slowpath() 44 atomic_add(_QR_BIAS, &lock->cnts); in queued_read_lock_slowpath() 56 arch_spin_unlock(&lock->wait_lock); in queued_read_lock_slowpath() 58 trace_contention_end(lock, 0); in queued_read_lock_slowpath() 73 arch_spin_lock(&lock->wait_lock); in queued_write_lock_slowpath() 76 if (!(cnts = atomic_read(&lock->cnts)) && in queued_write_lock_slowpath() 81 atomic_or(_QW_WAITING, &lock->cnts); in queued_write_lock_slowpath() 88 arch_spin_unlock(&lock->wait_lock); in queued_write_lock_slowpath() [all …]
|
H A D | mutex-debug.c | 39 lockdep_assert_held(&lock->wait_lock); in debug_mutex_wake_waiter() 40 DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list)); in debug_mutex_wake_waiter() 54 lockdep_assert_held(&lock->wait_lock); in debug_mutex_add_waiter() 72 void debug_mutex_unlock(struct mutex *lock) in debug_mutex_unlock() argument 75 DEBUG_LOCKS_WARN_ON(lock->magic != lock); in debug_mutex_unlock() 76 DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next); in debug_mutex_unlock() 87 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in debug_mutex_init() 90 lock->magic = lock; in debug_mutex_init() 112 void mutex_destroy(struct mutex *lock) in mutex_destroy() argument 114 DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock)); in mutex_destroy() [all …]
|
H A D | rtmutex_common.h | 56 struct rt_mutex_base *lock; member 112 return !RB_EMPTY_ROOT(&lock->waiters.rb_root); in rt_mutex_has_waiters() 123 struct rb_node *leftmost = rb_first_cached(&lock->waiters); in rt_mutex_waiter_is_top_waiter() 130 struct rb_node *leftmost = rb_first_cached(&lock->waiters); in rt_mutex_top_waiter() 133 lockdep_assert_held(&lock->wait_lock); in rt_mutex_top_waiter() 137 BUG_ON(w->lock != lock); in rt_mutex_top_waiter() 181 raw_spin_lock_init(&lock->wait_lock); in __rt_mutex_base_init() 182 lock->waiters = RB_ROOT_CACHED; in __rt_mutex_base_init() 183 lock->owner = NULL; in __rt_mutex_base_init() 190 DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current); in debug_rt_mutex_unlock() [all …]
|
H A D | spinlock_rt.c | 47 rtlock_lock(&lock->lock); in __rt_spin_lock() 55 __rt_spin_lock(lock); in rt_spin_lock() 63 __rt_spin_lock(lock); in rt_spin_lock_nested() 71 __rt_spin_lock(lock); in rt_spin_lock_nest_lock() 82 if (unlikely(!rt_mutex_cmpxchg_release(&lock->lock, current, NULL))) in rt_spin_unlock() 83 rt_mutex_slowunlock(&lock->lock); in rt_spin_unlock() 94 spin_lock(lock); in rt_spin_lock_unlock() 95 spin_unlock(lock); in rt_spin_lock_unlock() 103 if (unlikely(!rt_mutex_cmpxchg_acquire(&lock->lock, NULL, current))) in __rt_spin_trylock() 104 ret = rt_mutex_slowtrylock(&lock->lock); in __rt_spin_trylock() [all …]
|
H A D | qspinlock.c | 151 WRITE_ONCE(lock->pending, 0); in clear_pending() 183 return (u32)xchg_relaxed(&lock->tail, in xchg_tail() 327 if (virt_spin_lock(lock)) in queued_spin_lock_slowpath() 366 clear_pending(lock); in queued_spin_lock_slowpath() 390 clear_pending_set_locked(lock); in queued_spin_lock_slowpath() 418 while (!queued_spin_trylock(lock)) in queued_spin_lock_slowpath() 446 if (queued_spin_trylock(lock)) in queued_spin_lock_slowpath() 463 old = xchg_tail(lock, tail); in queued_spin_lock_slowpath() 548 set_locked(lock); in queued_spin_lock_slowpath() 557 pv_kick_node(lock, next); in queued_spin_lock_slowpath() [all …]
|
/openbmc/linux/fs/ocfs2/dlm/ |
H A D | dlmlock.c | 87 lock->ml.type)) in dlm_can_grant_new_lock() 129 dlm_lock_get(lock); in dlmlock_master() 412 if (!lock) in dlm_new_lock() 430 return lock; in dlm_new_lock() 587 if (!lock) { in dlmlock() 606 if (lock->lksb != lksb || lock->ast != ast || in dlmlock() 607 lock->bast != bast || lock->astdata != data) { in dlmlock() 612 "astdata=%p\n", lock->lksb, lock->ast, in dlmlock() 613 lock->bast, lock->astdata); in dlmlock() 652 if (!lock) { in dlmlock() [all …]
|
H A D | dlmconvert.c | 114 lock->ml.type, lock->ml.convert_type, type); in __dlmconvert_master() 171 if (tmplock == lock) in __dlmconvert_master() 194 lock->ml.type = type; in __dlmconvert_master() 280 if (lock->ml.type == type && lock->ml.convert_type == LKM_IVMODE) { in dlmconvert_remote() 287 lock->ml.type, lock->ml.convert_type); in dlmconvert_remote() 485 lock = tmp_lock; in dlm_convert_lock_handler() 486 dlm_lock_get(lock); in dlm_convert_lock_handler() 491 if (!lock) { in dlm_convert_lock_handler() 502 lksb = lock->lksb; in dlm_convert_lock_handler() 537 if (lock) in dlm_convert_lock_handler() [all …]
|
H A D | dlmunlock.c | 205 dlm_lock_get(lock); in dlmunlock_common() 209 dlm_lock_put(lock); in dlmunlock_common() 212 dlm_lock_get(lock); in dlmunlock_common() 222 dlm_lock_put(lock); in dlmunlock_common() 253 dlm_lock_put(lock); in dlmunlock_common() 467 lock = iter; in dlm_unlock_lock_handler() 471 if (lock) in dlm_unlock_lock_handler() 477 if (!lock) { in dlm_unlock_lock_handler() 483 lksb = lock->lksb; in dlm_unlock_lock_handler() 507 if (!lock) in dlm_unlock_lock_handler() [all …]
|
/openbmc/linux/tools/virtio/linux/ |
H 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 …]
|
/openbmc/linux/arch/arm/include/asm/ |
H A D | spinlock.h | 62 prefetchw(&lock->slock); in arch_spin_lock() 110 lock->tickets.owner++; in arch_spin_unlock() 116 return lock.tickets.owner == lock.tickets.next; in arch_spin_value_unlocked() 143 prefetchw(&rw->lock); in arch_write_lock() 162 prefetchw(&rw->lock); in arch_write_trylock() 211 prefetchw(&rw->lock); in arch_read_lock() 221 : "r" (&rw->lock) in arch_read_lock() 233 prefetchw(&rw->lock); in arch_read_unlock() 241 : "r" (&rw->lock) in arch_read_unlock() 252 prefetchw(&rw->lock); in arch_read_trylock() [all …]
|
/openbmc/linux/include/asm-generic/ |
H A D | qrwlock.h | 44 static inline int queued_read_trylock(struct qrwlock *lock) in queued_read_trylock() argument 48 cnts = atomic_read(&lock->cnts); in queued_read_trylock() 53 atomic_sub(_QR_BIAS, &lock->cnts); in queued_read_trylock() 67 cnts = atomic_read(&lock->cnts); in queued_write_trylock() 78 static inline void queued_read_lock(struct qrwlock *lock) in queued_read_lock() argument 82 cnts = atomic_add_return_acquire(_QR_BIAS, &lock->cnts); in queued_read_lock() 87 queued_read_lock_slowpath(lock); in queued_read_lock() 101 queued_write_lock_slowpath(lock); in queued_write_lock() 113 (void)atomic_sub_return_release(_QR_BIAS, &lock->cnts); in queued_read_unlock() 122 smp_store_release(&lock->wlocked, 0); in queued_write_unlock() [all …]
|
/openbmc/linux/arch/sh/include/asm/ |
H A D | spinlock-cas.h | 26 #define arch_spin_is_locked(x) ((x)->lock <= 0) 28 static inline void arch_spin_lock(arch_spinlock_t *lock) in arch_spin_lock() argument 30 while (!__sl_cas(&lock->lock, 1, 0)); in arch_spin_lock() 33 static inline void arch_spin_unlock(arch_spinlock_t *lock) in arch_spin_unlock() argument 35 __sl_cas(&lock->lock, 0, 1); in arch_spin_unlock() 40 return __sl_cas(&lock->lock, 1, 0); in arch_spin_trylock() 55 do old = rw->lock; in arch_read_lock() 62 do old = rw->lock; in arch_read_unlock() 63 while (__sl_cas(&rw->lock, old, old+1) != old); in arch_read_unlock() 73 __sl_cas(&rw->lock, 0, RW_LOCK_BIAS); in arch_write_unlock() [all …]
|
/openbmc/linux/arch/sparc/include/asm/ |
H A D | spinlock_32.h | 16 #define arch_spin_is_locked(lock) (*((volatile unsigned char *)(lock)) != 0) argument 34 : "r" (lock) in arch_spin_lock() 43 : "r" (lock) in arch_spin_trylock() 92 #define arch_read_lock(lock) \ argument 95 __arch_read_lock(lock); \ 112 #define arch_read_unlock(lock) \ argument 115 __arch_read_unlock(lock); \ 138 : "r" (lock) in arch_write_unlock() 148 : "r" (&rw->lock) in arch_write_trylock() 152 val = rw->lock & ~0xff; in arch_write_trylock() [all …]
|
/openbmc/linux/lib/ |
H A D | atomic64.c | 28 raw_spinlock_t lock; member 32 .lock = __RAW_SPIN_LOCK_UNLOCKED(atomic64_lock.lock), 48 raw_spinlock_t *lock = lock_addr(v); in generic_atomic64_read() local 51 raw_spin_lock_irqsave(lock, flags); in generic_atomic64_read() 61 raw_spinlock_t *lock = lock_addr(v); in generic_atomic64_set() local 63 raw_spin_lock_irqsave(lock, flags); in generic_atomic64_set() 134 raw_spinlock_t *lock = lock_addr(v); in generic_atomic64_dec_if_positive() local 137 raw_spin_lock_irqsave(lock, flags); in generic_atomic64_dec_if_positive() 152 raw_spin_lock_irqsave(lock, flags); in generic_atomic64_cmpxchg() 167 raw_spin_lock_irqsave(lock, flags); in generic_atomic64_xchg() [all …]
|
/openbmc/linux/arch/powerpc/include/asm/ |
H A D | qspinlock.h | 73 return READ_ONCE(lock->val); in queued_spin_is_locked() 78 return !lock.val; in queued_spin_value_unlocked() 83 return !!(READ_ONCE(lock->val) & _Q_TAIL_CPU_MASK); in queued_spin_is_contended() 107 : "r" (&lock->val), "r" (new), in __queued_spin_trylock_nosteal() 131 : "r" (&lock->val), "r" (new), "r" (_Q_TAIL_CPU_MASK), in __queued_spin_trylock_steal() 141 return __queued_spin_trylock_nosteal(lock); in queued_spin_trylock() 143 return __queued_spin_trylock_steal(lock); in queued_spin_trylock() 146 void queued_spin_lock_slowpath(struct qspinlock *lock); 150 if (!queued_spin_trylock(lock)) in queued_spin_lock() 151 queued_spin_lock_slowpath(lock); in queued_spin_lock() [all …]
|
/openbmc/linux/tools/perf/tests/shell/ |
H A D | lock_contention.sh | 30 if ! perf list | grep -q lock:contention_begin; then 42 perf lock contention -i ${perfdata} -E 1 -q 2> ${result} 54 if ! perf lock con -b true > /dev/null 2>&1 ; then 72 perf lock contention -i- -E 1 -q 2> ${result} 90 if ! perf lock con -b true > /dev/null 2>&1 ; then 113 if ! perf lock con -b true > /dev/null 2>&1 ; then 136 if ! perf lock con -b true > /dev/null 2>&1 ; then 168 if ! perf lock con -b true > /dev/null 2>&1 ; then 196 if ! perf lock con -b true > /dev/null 2>&1 ; then 224 if ! perf lock con -b true > /dev/null 2>&1 ; then [all …]
|
/openbmc/linux/fs/lockd/ |
H A D | xdr4.c | 76 struct file_lock *fl = &lock->fl; in svcxdr_decode_lock() 78 if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) in svcxdr_decode_lock() 94 nlm4svc_set_file_lock_range(fl, lock->lock_start, lock->lock_len); in svcxdr_decode_lock() 221 argp->lock.fl.fl_type = F_UNLCK; in nlm4svc_decode_unlockargs() 269 struct nlm_lock *lock = &argp->lock; in nlm4svc_decode_shareargs() local 271 memset(lock, 0, sizeof(*lock)); in nlm4svc_decode_shareargs() 272 locks_init_lock(&lock->fl); in nlm4svc_decode_shareargs() 273 lock->svid = ~(u32)0; in nlm4svc_decode_shareargs() 277 if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) in nlm4svc_decode_shareargs() 296 struct nlm_lock *lock = &argp->lock; in nlm4svc_decode_notify() local [all …]
|
H A D | svclock.c | 156 (long long)lock->fl.fl_end, lock->fl.fl_type); in nlmsvc_lookup_block() 422 locks_copy_lock(&call->a_args.lock.fl, &lock->fl); in nlmsvc_setgrantargs() 423 memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh)); in nlmsvc_setgrantargs() 425 call->a_args.lock.oh.len = lock->oh.len; in nlmsvc_setgrantargs() 438 memcpy(call->a_args.lock.oh.data, lock->oh.data, lock->oh.len); in nlmsvc_setgrantargs() 495 lock->fl.fl_type, lock->fl.fl_pid, in nlmsvc_lock() 516 lock = &block->b_call->a_args.lock; in nlmsvc_lock() 634 lock->fl.fl_type, (long long)lock->fl.fl_start, in nlmsvc_testlock() 665 lock->fl.fl_pid, in nlmsvc_unlock() 702 lock->fl.fl_pid, in nlmsvc_cancel_blocked() [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/progs/ |
H 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 …]
|
/openbmc/linux/drivers/clk/mmp/ |
H A D | clk-apbc.c | 29 spinlock_t *lock; member 42 if (apbc->lock) in clk_apbc_prepare() 51 if (apbc->lock) in clk_apbc_prepare() 56 if (apbc->lock) in clk_apbc_prepare() 63 if (apbc->lock) in clk_apbc_prepare() 69 if (apbc->lock) in clk_apbc_prepare() 89 if (apbc->lock) in clk_apbc_unprepare() 98 if (apbc->lock) in clk_apbc_unprepare() 103 if (apbc->lock) in clk_apbc_unprepare() 110 if (apbc->lock) in clk_apbc_unprepare() [all …]
|