/linux-6.12.1/include/linux/ |
D | spinlock_api_up.h | 19 #define assert_raw_spin_locked(lock) do { (void)(lock); } while (0) argument 27 #define ___LOCK(lock) \ argument 28 do { __acquire(lock); (void)(lock); } while (0) 30 #define __LOCK(lock) \ argument 31 do { preempt_disable(); ___LOCK(lock); } while (0) 33 #define __LOCK_BH(lock) \ argument 34 do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0) 36 #define __LOCK_IRQ(lock) \ argument 37 do { local_irq_disable(); __LOCK(lock); } while (0) 39 #define __LOCK_IRQSAVE(lock, flags) \ argument [all …]
|
D | rwlock_api_smp.h | 18 void __lockfunc _raw_read_lock(rwlock_t *lock) __acquires(lock); 19 void __lockfunc _raw_write_lock(rwlock_t *lock) __acquires(lock); 20 void __lockfunc _raw_write_lock_nested(rwlock_t *lock, int subclass) __acquires(lock); 21 void __lockfunc _raw_read_lock_bh(rwlock_t *lock) __acquires(lock); 22 void __lockfunc _raw_write_lock_bh(rwlock_t *lock) __acquires(lock); 23 void __lockfunc _raw_read_lock_irq(rwlock_t *lock) __acquires(lock); 24 void __lockfunc _raw_write_lock_irq(rwlock_t *lock) __acquires(lock); 25 unsigned long __lockfunc _raw_read_lock_irqsave(rwlock_t *lock) 26 __acquires(lock); 27 unsigned long __lockfunc _raw_write_lock_irqsave(rwlock_t *lock) [all …]
|
D | spinlock.h | 101 extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, 104 # define raw_spin_lock_init(lock) \ argument 108 __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN); \ 112 # define raw_spin_lock_init(lock) \ argument 113 do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0) 116 #define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock) argument 119 #define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock) argument 121 #define raw_spin_is_contended(lock) (((void)(lock), 0)) argument 180 extern void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); 181 extern int do_raw_spin_trylock(raw_spinlock_t *lock); [all …]
|
D | rwlock.h | 18 extern void __rwlock_init(rwlock_t *lock, const char *name, 20 # define rwlock_init(lock) \ argument 24 __rwlock_init((lock), #lock, &__key); \ 27 # define rwlock_init(lock) \ argument 28 do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) 32 extern void do_raw_read_lock(rwlock_t *lock) __acquires(lock); 33 extern int do_raw_read_trylock(rwlock_t *lock); 34 extern void do_raw_read_unlock(rwlock_t *lock) __releases(lock); 35 extern void do_raw_write_lock(rwlock_t *lock) __acquires(lock); 36 extern int do_raw_write_trylock(rwlock_t *lock); [all …]
|
D | spinlock_api_smp.h | 22 void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); 23 void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) 24 __acquires(lock); 26 _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) 27 __acquires(lock); 28 void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) __acquires(lock); 29 void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock) 30 __acquires(lock); 32 unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock) 33 __acquires(lock); [all …]
|
D | spinlock_rt.h | 10 extern void __rt_spin_lock_init(spinlock_t *lock, const char *name, 13 static inline void __rt_spin_lock_init(spinlock_t *lock, const char *name, in __rt_spin_lock_init() argument 23 rt_mutex_base_init(&(slock)->lock); \ 31 rt_mutex_base_init(&(slock)->lock); \ 35 extern void rt_spin_lock(spinlock_t *lock); 36 extern void rt_spin_lock_nested(spinlock_t *lock, int subclass); 37 extern void rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock); 38 extern void rt_spin_unlock(spinlock_t *lock); 39 extern void rt_spin_lock_unlock(spinlock_t *lock); 40 extern int rt_spin_trylock_bh(spinlock_t *lock); [all …]
|
D | spinlock_up.h | 29 static inline void arch_spin_lock(arch_spinlock_t *lock) in arch_spin_lock() argument 31 lock->slock = 0; in arch_spin_lock() 35 static inline int arch_spin_trylock(arch_spinlock_t *lock) in arch_spin_trylock() argument 37 char oldval = lock->slock; in arch_spin_trylock() 39 lock->slock = 0; in arch_spin_trylock() 45 static inline void arch_spin_unlock(arch_spinlock_t *lock) in arch_spin_unlock() argument 48 lock->slock = 1; in arch_spin_unlock() 54 #define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0) argument 55 #define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0) argument 56 #define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; }) argument [all …]
|
D | local_lock_internal.h | 54 #define __local_lock_init(lock) \ argument 58 debug_check_no_locks_freed((void *)lock, sizeof(*lock));\ 59 lockdep_init_map_type(&(lock)->dep_map, #lock, &__key, \ 62 local_lock_debug_init(lock); \ 65 #define __spinlock_nested_bh_init(lock) \ argument 69 debug_check_no_locks_freed((void *)lock, sizeof(*lock));\ 70 lockdep_init_map_type(&(lock)->dep_map, #lock, &__key, \ 73 local_lock_debug_init(lock); \ 76 #define __local_lock(lock) \ argument 79 local_lock_acquire(this_cpu_ptr(lock)); \ [all …]
|
D | mutex.h | 42 extern void mutex_destroy(struct mutex *lock); 48 static inline void mutex_destroy(struct mutex *lock) {} in mutex_destroy() argument 89 extern void __mutex_init(struct mutex *lock, const char *name, 98 extern bool mutex_is_locked(struct mutex *lock); 114 extern void __mutex_rt_init(struct mutex *lock, const char *name, 129 int __devm_mutex_init(struct device *dev, struct mutex *lock); 133 static inline int __devm_mutex_init(struct device *dev, struct mutex *lock) in __devm_mutex_init() argument 157 extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 158 extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); 160 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, [all …]
|
D | lockdep.h | 90 extern void lockdep_reset_lock(struct lockdep_map *lock); 128 extern void lockdep_init_map_type(struct lockdep_map *lock, const char *name, 132 lockdep_init_map_waits(struct lockdep_map *lock, const char *name, in lockdep_init_map_waits() argument 135 lockdep_init_map_type(lock, name, key, subclass, inner, outer, LD_LOCK_NORMAL); in lockdep_init_map_waits() 139 lockdep_init_map_wait(struct lockdep_map *lock, const char *name, in lockdep_init_map_wait() argument 142 lockdep_init_map_waits(lock, name, key, subclass, inner, LD_WAIT_INV); in lockdep_init_map_wait() 145 static inline void lockdep_init_map(struct lockdep_map *lock, const char *name, in lockdep_init_map() argument 148 lockdep_init_map_wait(lock, name, key, subclass, LD_WAIT_INV); in lockdep_init_map() 157 #define lockdep_set_class(lock, key) \ argument 158 lockdep_init_map_type(&(lock)->dep_map, #key, key, 0, \ [all …]
|
/linux-6.12.1/kernel/locking/ |
D | spinlock_debug.c | 17 void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, in __raw_spin_lock_init() argument 24 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __raw_spin_lock_init() 25 lockdep_init_map_wait(&lock->dep_map, name, key, 0, inner); in __raw_spin_lock_init() 27 lock->raw_lock = (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; in __raw_spin_lock_init() 28 lock->magic = SPINLOCK_MAGIC; in __raw_spin_lock_init() 29 lock->owner = SPINLOCK_OWNER_INIT; in __raw_spin_lock_init() 30 lock->owner_cpu = -1; in __raw_spin_lock_init() 36 void __rwlock_init(rwlock_t *lock, const char *name, in __rwlock_init() argument 43 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __rwlock_init() 44 lockdep_init_map_wait(&lock->dep_map, name, key, 0, LD_WAIT_CONFIG); in __rwlock_init() [all …]
|
D | mutex.c | 46 __mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key) in __mutex_init() argument 48 atomic_long_set(&lock->owner, 0); in __mutex_init() 49 raw_spin_lock_init(&lock->wait_lock); in __mutex_init() 50 INIT_LIST_HEAD(&lock->wait_list); in __mutex_init() 52 osq_lock_init(&lock->osq); in __mutex_init() 55 debug_mutex_init(lock, name, key); in __mutex_init() 79 static inline struct task_struct *__mutex_owner(struct mutex *lock) in __mutex_owner() argument 81 return (struct task_struct *)(atomic_long_read(&lock->owner) & ~MUTEX_FLAGS); in __mutex_owner() 89 bool mutex_is_locked(struct mutex *lock) in mutex_is_locked() argument 91 return __mutex_owner(lock) != NULL; in mutex_is_locked() [all …]
|
D | rtmutex_api.c | 22 static __always_inline int __rt_mutex_lock_common(struct rt_mutex *lock, in __rt_mutex_lock_common() argument 30 mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, _RET_IP_); in __rt_mutex_lock_common() 31 ret = __rt_mutex_lock(&lock->rtmutex, state); in __rt_mutex_lock_common() 33 mutex_release(&lock->dep_map, _RET_IP_); in __rt_mutex_lock_common() 50 void __sched rt_mutex_lock_nested(struct rt_mutex *lock, unsigned int subclass) in rt_mutex_lock_nested() argument 52 __rt_mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, NULL, subclass); in rt_mutex_lock_nested() 56 void __sched _rt_mutex_lock_nest_lock(struct rt_mutex *lock, struct lockdep_map *nest_lock) in _rt_mutex_lock_nest_lock() argument 58 __rt_mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, nest_lock, 0); in _rt_mutex_lock_nest_lock() 69 void __sched rt_mutex_lock(struct rt_mutex *lock) in rt_mutex_lock() argument 71 __rt_mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, NULL, 0); in rt_mutex_lock() [all …]
|
D | spinlock.c | 68 void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ 72 if (likely(do_raw_##op##_trylock(lock))) \ 76 arch_##op##_relax(&lock->raw_lock); \ 80 unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ 87 if (likely(do_raw_##op##_trylock(lock))) \ 92 arch_##op##_relax(&lock->raw_lock); \ 98 void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \ 100 _raw_##op##_lock_irqsave(lock); \ 103 void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ 112 flags = _raw_##op##_lock_irqsave(lock); \ [all …]
|
D | rtmutex.c | 36 struct rt_mutex *lock, in __ww_mutex_add_waiter() argument 42 static inline void __ww_mutex_check_waiters(struct rt_mutex *lock, in __ww_mutex_check_waiters() argument 47 static inline void ww_mutex_lock_acquired(struct ww_mutex *lock, in ww_mutex_lock_acquired() argument 52 static inline int __ww_mutex_check_kill(struct rt_mutex *lock, in __ww_mutex_check_kill() argument 93 rt_mutex_owner_encode(struct rt_mutex_base *lock, struct task_struct *owner) in rt_mutex_owner_encode() argument 97 if (rt_mutex_has_waiters(lock)) in rt_mutex_owner_encode() 104 rt_mutex_set_owner(struct rt_mutex_base *lock, struct task_struct *owner) in rt_mutex_set_owner() argument 110 xchg_acquire(&lock->owner, rt_mutex_owner_encode(lock, owner)); in rt_mutex_set_owner() 113 static __always_inline void rt_mutex_clear_owner(struct rt_mutex_base *lock) in rt_mutex_clear_owner() argument 116 WRITE_ONCE(lock->owner, rt_mutex_owner_encode(lock, NULL)); in rt_mutex_clear_owner() [all …]
|
D | ww_mutex.h | 9 __ww_waiter_first(struct mutex *lock) in __ww_waiter_first() argument 13 w = list_first_entry(&lock->wait_list, struct mutex_waiter, list); in __ww_waiter_first() 14 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_first() 21 __ww_waiter_next(struct mutex *lock, struct mutex_waiter *w) in __ww_waiter_next() argument 24 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_next() 31 __ww_waiter_prev(struct mutex *lock, struct mutex_waiter *w) in __ww_waiter_prev() argument 34 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_prev() 41 __ww_waiter_last(struct mutex *lock) in __ww_waiter_last() argument 45 w = list_last_entry(&lock->wait_list, struct mutex_waiter, list); in __ww_waiter_last() 46 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_last() [all …]
|
/linux-6.12.1/fs/bcachefs/ |
D | six.c | 27 static void do_six_unlock_type(struct six_lock *lock, enum six_lock_type type); 72 static inline void six_set_bitmask(struct six_lock *lock, u32 mask) in six_set_bitmask() argument 74 if ((atomic_read(&lock->state) & mask) != mask) in six_set_bitmask() 75 atomic_or(mask, &lock->state); in six_set_bitmask() 78 static inline void six_clear_bitmask(struct six_lock *lock, u32 mask) in six_clear_bitmask() argument 80 if (atomic_read(&lock->state) & mask) in six_clear_bitmask() 81 atomic_and(~mask, &lock->state); in six_clear_bitmask() 84 static inline void six_set_owner(struct six_lock *lock, enum six_lock_type type, in six_set_owner() argument 91 EBUG_ON(lock->owner); in six_set_owner() 92 lock->owner = owner; in six_set_owner() [all …]
|
D | six.h | 157 typedef int (*six_lock_should_sleep_fn)(struct six_lock *lock, void *); 159 void six_lock_exit(struct six_lock *lock); 165 void __six_lock_init(struct six_lock *lock, const char *name, 173 #define six_lock_init(lock, flags) \ argument 177 __six_lock_init((lock), #lock, &__key, flags); \ 191 static inline u32 six_lock_seq(const struct six_lock *lock) in six_lock_seq() argument 193 return lock->seq; in six_lock_seq() 196 bool six_trylock_ip(struct six_lock *lock, enum six_lock_type type, unsigned long ip); 205 static inline bool six_trylock_type(struct six_lock *lock, enum six_lock_type type) in six_trylock_type() argument 207 return six_trylock_ip(lock, type, _THIS_IP_); in six_trylock_type() [all …]
|
/linux-6.12.1/arch/alpha/include/asm/ |
D | spinlock.h | 17 #define arch_spin_is_locked(x) ((x)->lock != 0) 19 static inline int arch_spin_value_unlocked(arch_spinlock_t lock) in arch_spin_value_unlocked() argument 21 return lock.lock == 0; in arch_spin_value_unlocked() 24 static inline void arch_spin_unlock(arch_spinlock_t * lock) in arch_spin_unlock() argument 27 lock->lock = 0; in arch_spin_unlock() 30 static inline void arch_spin_lock(arch_spinlock_t * lock) in arch_spin_lock() argument 46 : "=&r" (tmp), "=m" (lock->lock) in arch_spin_lock() 47 : "m"(lock->lock) : "memory"); in arch_spin_lock() 50 static inline int arch_spin_trylock(arch_spinlock_t *lock) in arch_spin_trylock() argument 52 return !test_and_set_bit(0, &lock->lock); in arch_spin_trylock() [all …]
|
/linux-6.12.1/drivers/md/persistent-data/ |
D | dm-block-manager.c | 45 spinlock_t lock; member 61 static unsigned int __find_holder(struct block_lock *lock, in __find_holder() argument 67 if (lock->holders[i] == task) in __find_holder() 75 static void __add_holder(struct block_lock *lock, struct task_struct *task) in __add_holder() argument 77 unsigned int h = __find_holder(lock, NULL); in __add_holder() 83 lock->holders[h] = task; in __add_holder() 86 t = lock->traces + h; in __add_holder() 92 static void __del_holder(struct block_lock *lock, struct task_struct *task) in __del_holder() argument 94 unsigned int h = __find_holder(lock, task); in __del_holder() 96 lock->holders[h] = NULL; in __del_holder() [all …]
|
/linux-6.12.1/fs/ocfs2/dlm/ |
D | dlmast.c | 35 struct dlm_lock *lock); 36 static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock); 47 static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) in dlm_should_cancel_bast() argument 50 assert_spin_locked(&lock->spinlock); in dlm_should_cancel_bast() 52 if (lock->ml.highest_blocked == LKM_IVMODE) in dlm_should_cancel_bast() 54 BUG_ON(lock->ml.highest_blocked == LKM_NLMODE); in dlm_should_cancel_bast() 56 if (lock->bast_pending && in dlm_should_cancel_bast() 57 list_empty(&lock->bast_list)) in dlm_should_cancel_bast() 61 if (lock->ml.type == LKM_EXMODE) in dlm_should_cancel_bast() 64 else if (lock->ml.type == LKM_NLMODE) in dlm_should_cancel_bast() [all …]
|
D | dlmlock.c | 45 struct dlm_lock *lock, int flags); 49 static void dlm_lock_detach_lockres(struct dlm_lock *lock); 74 struct dlm_lock *lock) in dlm_can_grant_new_lock() argument 79 if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type)) in dlm_can_grant_new_lock() 84 if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type)) in dlm_can_grant_new_lock() 87 lock->ml.type)) in dlm_can_grant_new_lock() 103 struct dlm_lock *lock, int flags) in dlmlock_master() argument 108 mlog(0, "type=%d\n", lock->ml.type); in dlmlock_master() 115 lock->ml.node != dlm->node_num) { in dlmlock_master() 124 if (dlm_can_grant_new_lock(res, lock)) { in dlmlock_master() [all …]
|
/linux-6.12.1/arch/hexagon/include/asm/ |
D | spinlock.h | 28 static inline void arch_read_lock(arch_rwlock_t *lock) in arch_read_lock() argument 37 : "r" (&lock->lock) in arch_read_lock() 43 static inline void arch_read_unlock(arch_rwlock_t *lock) in arch_read_unlock() argument 51 : "r" (&lock->lock) in arch_read_unlock() 58 static inline int arch_read_trylock(arch_rwlock_t *lock) in arch_read_trylock() argument 69 : "r" (&lock->lock) in arch_read_trylock() 76 static inline void arch_write_lock(arch_rwlock_t *lock) in arch_write_lock() argument 85 : "r" (&lock->lock) in arch_write_lock() 91 static inline int arch_write_trylock(arch_rwlock_t *lock) in arch_write_trylock() argument 102 : "r" (&lock->lock) in arch_write_trylock() [all …]
|
/linux-6.12.1/arch/powerpc/include/asm/ |
D | simple_spinlock.h | 35 static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) in arch_spin_value_unlocked() argument 37 return lock.slock == 0; in arch_spin_value_unlocked() 40 static inline int arch_spin_is_locked(arch_spinlock_t *lock) in arch_spin_is_locked() argument 42 return !arch_spin_value_unlocked(READ_ONCE(*lock)); in arch_spin_is_locked() 49 static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock) in __arch_spin_trylock() argument 64 : "r" (token), "r" (&lock->slock), [eh] "n" (eh) in __arch_spin_trylock() 70 static inline int arch_spin_trylock(arch_spinlock_t *lock) in arch_spin_trylock() argument 72 return __arch_spin_trylock(lock) == 0; in arch_spin_trylock() 91 void splpar_spin_yield(arch_spinlock_t *lock); 92 void splpar_rw_yield(arch_rwlock_t *lock); [all …]
|
/linux-6.12.1/drivers/acpi/acpica/ |
D | utlock.c | 28 acpi_status acpi_ut_create_rw_lock(struct acpi_rw_lock *lock) in acpi_ut_create_rw_lock() argument 32 lock->num_readers = 0; in acpi_ut_create_rw_lock() 33 status = acpi_os_create_mutex(&lock->reader_mutex); in acpi_ut_create_rw_lock() 38 status = acpi_os_create_mutex(&lock->writer_mutex); in acpi_ut_create_rw_lock() 42 void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock) in acpi_ut_delete_rw_lock() argument 45 acpi_os_delete_mutex(lock->reader_mutex); in acpi_ut_delete_rw_lock() 46 acpi_os_delete_mutex(lock->writer_mutex); in acpi_ut_delete_rw_lock() 48 lock->num_readers = 0; in acpi_ut_delete_rw_lock() 49 lock->reader_mutex = NULL; in acpi_ut_delete_rw_lock() 50 lock->writer_mutex = NULL; in acpi_ut_delete_rw_lock() [all …]
|