Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 3634) sorted by relevance

12345678910>>...146

/linux-6.1.9/include/linux/
Dspinlock_api_up.h19 #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 …]
Drwlock_api_smp.h18 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 …]
Dspinlock.h100 extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
103 # define raw_spin_lock_init(lock) \ argument
107 __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN); \
111 # define raw_spin_lock_init(lock) \ argument
112 do { *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock); } while (0)
115 #define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock) argument
118 #define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock) argument
120 #define raw_spin_is_contended(lock) (((void)(lock), 0)) argument
179 extern void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock);
180 extern int do_raw_spin_trylock(raw_spinlock_t *lock);
[all …]
Drwlock.h18 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 …]
Dspinlock_api_smp.h22 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 …]
Dspinlock_rt.h10 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 …]
Dspinlock_up.h29 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 …]
Dmutex.h83 extern void mutex_destroy(struct mutex *lock);
89 static inline void mutex_destroy(struct mutex *lock) {} in mutex_destroy() argument
118 extern void __mutex_init(struct mutex *lock, const char *name,
127 extern bool mutex_is_locked(struct mutex *lock);
151 extern void __mutex_rt_init(struct mutex *lock, const char *name,
153 extern int mutex_trylock(struct mutex *lock);
155 static inline void mutex_destroy(struct mutex *lock) { } in mutex_destroy() argument
178 extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
179 extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
181 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
[all …]
Dlockdep.h146 extern void lockdep_reset_lock(struct lockdep_map *lock);
184 extern void lockdep_init_map_type(struct lockdep_map *lock, const char *name,
188 lockdep_init_map_waits(struct lockdep_map *lock, const char *name, in lockdep_init_map_waits() argument
191 lockdep_init_map_type(lock, name, key, subclass, inner, outer, LD_LOCK_NORMAL); in lockdep_init_map_waits()
195 lockdep_init_map_wait(struct lockdep_map *lock, const char *name, in lockdep_init_map_wait() argument
198 lockdep_init_map_waits(lock, name, key, subclass, inner, LD_WAIT_INV); in lockdep_init_map_wait()
201 static inline void lockdep_init_map(struct lockdep_map *lock, const char *name, in lockdep_init_map() argument
204 lockdep_init_map_wait(lock, name, key, subclass, LD_WAIT_INV); in lockdep_init_map()
213 #define lockdep_set_class(lock, key) \ argument
214 lockdep_init_map_type(&(lock)->dep_map, #key, key, 0, \
[all …]
/linux-6.1.9/kernel/locking/
Dspinlock_debug.c16 void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, in __raw_spin_lock_init() argument
23 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __raw_spin_lock_init()
24 lockdep_init_map_wait(&lock->dep_map, name, key, 0, inner); in __raw_spin_lock_init()
26 lock->raw_lock = (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; in __raw_spin_lock_init()
27 lock->magic = SPINLOCK_MAGIC; in __raw_spin_lock_init()
28 lock->owner = SPINLOCK_OWNER_INIT; in __raw_spin_lock_init()
29 lock->owner_cpu = -1; in __raw_spin_lock_init()
35 void __rwlock_init(rwlock_t *lock, const char *name, in __rwlock_init() argument
42 debug_check_no_locks_freed((void *)lock, sizeof(*lock)); in __rwlock_init()
43 lockdep_init_map_wait(&lock->dep_map, name, key, 0, LD_WAIT_CONFIG); in __rwlock_init()
[all …]
Dmutex.c46 __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 …]
Drtmutex_api.c22 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 …]
Dspinlock.c68 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 …]
Dww_mutex.h9 __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 …]
Drtmutex.c36 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 …]
/linux-6.1.9/arch/alpha/include/asm/
Dspinlock.h17 #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.1.9/drivers/gpu/drm/
Ddrm_lock.c63 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_take() local
67 old = *lock; in drm_lock_take()
75 prev = cmpxchg(lock, old, new); in drm_lock_take()
112 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_transfer() local
116 old = *lock; in drm_lock_transfer()
118 prev = cmpxchg(lock, old, new); in drm_lock_transfer()
127 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_legacy_lock_free() local
139 old = *lock; in drm_legacy_lock_free()
141 prev = cmpxchg(lock, old, new); in drm_legacy_lock_free()
168 struct drm_lock *lock = data; in drm_legacy_lock() local
[all …]
/linux-6.1.9/arch/hexagon/include/asm/
Dspinlock.h28 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.1.9/drivers/md/persistent-data/
Ddm-block-manager.c44 spinlock_t lock; member
60 static unsigned __find_holder(struct block_lock *lock, in __find_holder() argument
66 if (lock->holders[i] == task) in __find_holder()
74 static void __add_holder(struct block_lock *lock, struct task_struct *task) in __add_holder() argument
76 unsigned h = __find_holder(lock, NULL); in __add_holder()
82 lock->holders[h] = task; in __add_holder()
85 t = lock->traces + h; in __add_holder()
91 static void __del_holder(struct block_lock *lock, struct task_struct *task) in __del_holder() argument
93 unsigned h = __find_holder(lock, task); in __del_holder()
94 lock->holders[h] = NULL; in __del_holder()
[all …]
/linux-6.1.9/fs/ocfs2/dlm/
Ddlmast.c35 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 …]
Ddlmlock.c45 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.1.9/arch/ia64/include/asm/
Dspinlock.h22 #define arch_spin_lock_init(x) ((x)->lock = 0)
43 static __always_inline void __ticket_spin_lock(arch_spinlock_t *lock) in __ticket_spin_lock() argument
45 int *p = (int *)&lock->lock, ticket, serve; in __ticket_spin_lock()
63 static __always_inline int __ticket_spin_trylock(arch_spinlock_t *lock) in __ticket_spin_trylock() argument
65 int tmp = READ_ONCE(lock->lock); in __ticket_spin_trylock()
68 return ia64_cmpxchg(acq, &lock->lock, tmp, tmp + 1, sizeof (tmp)) == tmp; in __ticket_spin_trylock()
72 static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock) in __ticket_spin_unlock() argument
74 unsigned short *p = (unsigned short *)&lock->lock + 1, tmp; in __ticket_spin_unlock()
82 static inline int __ticket_spin_is_locked(arch_spinlock_t *lock) in __ticket_spin_is_locked() argument
84 long tmp = READ_ONCE(lock->lock); in __ticket_spin_is_locked()
[all …]
/linux-6.1.9/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/
Dlocks.h26 static inline void lock_impl_lock(struct lock_impl *lock) in lock_impl_lock() argument
28 BUG_ON(pthread_mutex_lock(&lock->mutex)); in lock_impl_lock()
31 static inline void lock_impl_unlock(struct lock_impl *lock) in lock_impl_unlock() argument
33 BUG_ON(pthread_mutex_unlock(&lock->mutex)); in lock_impl_unlock()
36 static inline bool lock_impl_trylock(struct lock_impl *lock) in lock_impl_trylock() argument
38 int err = pthread_mutex_trylock(&lock->mutex); in lock_impl_trylock()
47 static inline void lock_impl_init(struct lock_impl *lock) in lock_impl_init() argument
49 pthread_mutex_init(&lock->mutex, NULL); in lock_impl_init()
61 static inline bool lock_impl_trylock(struct lock_impl *lock) in lock_impl_trylock() argument
65 return __sync_bool_compare_and_swap(&lock->locked, false, true); in lock_impl_trylock()
[all …]
/linux-6.1.9/arch/powerpc/include/asm/
Dsimple_spinlock.h34 static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) in arch_spin_value_unlocked() argument
36 return lock.slock == 0; in arch_spin_value_unlocked()
39 static inline int arch_spin_is_locked(arch_spinlock_t *lock) in arch_spin_is_locked() argument
41 return !arch_spin_value_unlocked(READ_ONCE(*lock)); in arch_spin_is_locked()
48 static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock) in __arch_spin_trylock() argument
63 : "r" (token), "r" (&lock->slock), [eh] "n" (eh) in __arch_spin_trylock()
69 static inline int arch_spin_trylock(arch_spinlock_t *lock) in arch_spin_trylock() argument
71 return __arch_spin_trylock(lock) == 0; in arch_spin_trylock()
90 void splpar_spin_yield(arch_spinlock_t *lock);
91 void splpar_rw_yield(arch_rwlock_t *lock);
[all …]
/linux-6.1.9/drivers/acpi/acpica/
Dutlock.c28 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 …]

12345678910>>...146