Home
last modified time | relevance | path

Searched refs:waiter (Results 1 – 11 of 11) sorted by relevance

/kernel/locking/
Drtmutex.c245 rt_mutex_enqueue(struct rt_mutex *lock, struct rt_mutex_waiter *waiter) in rt_mutex_enqueue() argument
255 if (rt_mutex_waiter_less(waiter, entry)) { in rt_mutex_enqueue()
264 lock->waiters_leftmost = &waiter->tree_entry; in rt_mutex_enqueue()
266 rb_link_node(&waiter->tree_entry, parent, link); in rt_mutex_enqueue()
267 rb_insert_color(&waiter->tree_entry, &lock->waiters); in rt_mutex_enqueue()
271 rt_mutex_dequeue(struct rt_mutex *lock, struct rt_mutex_waiter *waiter) in rt_mutex_dequeue() argument
273 if (RB_EMPTY_NODE(&waiter->tree_entry)) in rt_mutex_dequeue()
276 if (lock->waiters_leftmost == &waiter->tree_entry) in rt_mutex_dequeue()
277 lock->waiters_leftmost = rb_next(&waiter->tree_entry); in rt_mutex_dequeue()
279 rb_erase(&waiter->tree_entry, &lock->waiters); in rt_mutex_dequeue()
[all …]
Dmutex-debug.c30 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common() argument
32 memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter)); in debug_mutex_lock_common()
33 waiter->magic = waiter; in debug_mutex_lock_common()
34 INIT_LIST_HEAD(&waiter->list); in debug_mutex_lock_common()
37 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_wake_waiter() argument
41 DEBUG_LOCKS_WARN_ON(waiter->magic != waiter); in debug_mutex_wake_waiter()
42 DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list)); in debug_mutex_wake_waiter()
45 void debug_mutex_free_waiter(struct mutex_waiter *waiter) in debug_mutex_free_waiter() argument
47 DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list)); in debug_mutex_free_waiter()
48 memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter)); in debug_mutex_free_waiter()
[all …]
Drwsem-spinlock.c67 struct rwsem_waiter *waiter; in __rwsem_do_wake() local
71 waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list); in __rwsem_do_wake()
73 if (waiter->type == RWSEM_WAITING_FOR_WRITE) { in __rwsem_do_wake()
77 wake_up_process(waiter->task); in __rwsem_do_wake()
84 struct list_head *next = waiter->list.next; in __rwsem_do_wake()
86 list_del(&waiter->list); in __rwsem_do_wake()
87 tsk = waiter->task; in __rwsem_do_wake()
96 waiter->task = NULL; in __rwsem_do_wake()
102 waiter = list_entry(next, struct rwsem_waiter, list); in __rwsem_do_wake()
103 } while (waiter->type != RWSEM_WAITING_FOR_WRITE); in __rwsem_do_wake()
[all …]
Drtmutex-debug.c85 void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter) in debug_rt_mutex_print_deadlock() argument
89 if (!waiter->deadlock_lock || !debug_locks) in debug_rt_mutex_print_deadlock()
93 task = pid_task(waiter->deadlock_task_pid, PIDTYPE_PID); in debug_rt_mutex_print_deadlock()
114 printk_lock(waiter->lock, 1); in debug_rt_mutex_print_deadlock()
118 printk_lock(waiter->deadlock_lock, 1); in debug_rt_mutex_print_deadlock()
155 void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter) in debug_rt_mutex_init_waiter() argument
157 memset(waiter, 0x11, sizeof(*waiter)); in debug_rt_mutex_init_waiter()
158 waiter->deadlock_task_pid = NULL; in debug_rt_mutex_init_waiter()
161 void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter) in debug_rt_mutex_free_waiter() argument
163 put_pid(waiter->deadlock_task_pid); in debug_rt_mutex_free_waiter()
[all …]
Drwsem-xadd.c128 struct rwsem_waiter *waiter, *tmp; in __rwsem_mark_wake() local
135 waiter = list_first_entry(&sem->wait_list, struct rwsem_waiter, list); in __rwsem_mark_wake()
137 if (waiter->type == RWSEM_WAITING_FOR_WRITE) { in __rwsem_mark_wake()
146 wake_q_add(wake_q, waiter->task); in __rwsem_mark_wake()
189 list_for_each_entry_safe(waiter, tmp, &sem->wait_list, list) { in __rwsem_mark_wake()
192 if (waiter->type == RWSEM_WAITING_FOR_WRITE) in __rwsem_mark_wake()
196 tsk = waiter->task; in __rwsem_mark_wake()
199 list_del(&waiter->list); in __rwsem_mark_wake()
206 smp_store_release(&waiter->task, NULL); in __rwsem_mark_wake()
226 struct rwsem_waiter waiter; in rwsem_down_read_failed() local
[all …]
Dsemaphore.c208 struct semaphore_waiter waiter; in __down_common() local
210 list_add_tail(&waiter.list, &sem->wait_list); in __down_common()
211 waiter.task = task; in __down_common()
212 waiter.up = false; in __down_common()
223 if (waiter.up) in __down_common()
228 list_del(&waiter.list); in __down_common()
232 list_del(&waiter.list); in __down_common()
258 struct semaphore_waiter *waiter = list_first_entry(&sem->wait_list, in __up() local
260 list_del(&waiter->list); in __up()
261 waiter->up = true; in __up()
[all …]
Dmutex.h16 #define mutex_remove_waiter(lock, waiter, task) \ argument
17 __list_del((waiter)->list.prev, (waiter)->list.next)
45 #define debug_mutex_wake_waiter(lock, waiter) do { } while (0) argument
46 #define debug_mutex_free_waiter(waiter) do { } while (0) argument
47 #define debug_mutex_add_waiter(lock, waiter, ti) do { } while (0) argument
52 debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common() argument
Drtmutex-debug.h15 extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
16 extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
24 struct rt_mutex_waiter *waiter,
26 extern void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter);
30 static inline bool debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter, in debug_rt_mutex_detect_deadlock() argument
33 return (waiter != NULL); in debug_rt_mutex_detect_deadlock()
Dmutex-debug.h17 struct mutex_waiter *waiter);
19 struct mutex_waiter *waiter);
20 extern void debug_mutex_free_waiter(struct mutex_waiter *waiter);
22 struct mutex_waiter *waiter,
24 extern void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
Dmutex.c510 struct mutex_waiter waiter; in __mutex_lock_common() local
539 debug_mutex_lock_common(lock, &waiter); in __mutex_lock_common()
540 debug_mutex_add_waiter(lock, &waiter, task); in __mutex_lock_common()
543 list_add_tail(&waiter.list, &lock->wait_list); in __mutex_lock_common()
544 waiter.task = task; in __mutex_lock_common()
587 mutex_remove_waiter(lock, &waiter, task); in __mutex_lock_common()
591 debug_mutex_free_waiter(&waiter); in __mutex_lock_common()
608 mutex_remove_waiter(lock, &waiter, task); in __mutex_lock_common()
610 debug_mutex_free_waiter(&waiter); in __mutex_lock_common()
745 struct mutex_waiter *waiter = in __mutex_unlock_common_slowpath() local
[all …]
Drtmutex_common.h108 struct rt_mutex_waiter *waiter,
112 struct rt_mutex_waiter *waiter);