Home
last modified time | relevance | path

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

123

/linux/kernel/locking/
H A Dmutex-debug.c29 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common()
31 memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter)); in debug_mutex_lock_common()
32 waiter->magic = waiter; in debug_mutex_lock_common()
33 INIT_LIST_HEAD(&waiter->list); in debug_mutex_lock_common()
34 waiter->ww_ctx = MUTEX_POISON_WW_CTX; in debug_mutex_lock_common()
37 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_wake_waiter()
41 DEBUG_LOCKS_WARN_ON(waiter->magic != waiter); in debug_mutex_wake_waiter()
28 debug_mutex_lock_common(struct mutex * lock,struct mutex_waiter * waiter) debug_mutex_lock_common() argument
36 debug_mutex_wake_waiter(struct mutex * lock,struct mutex_waiter * waiter) debug_mutex_wake_waiter() argument
44 debug_mutex_free_waiter(struct mutex_waiter * waiter) debug_mutex_free_waiter() argument
50 debug_mutex_add_waiter(struct mutex * lock,struct mutex_waiter * waiter,struct task_struct * task) debug_mutex_add_waiter() argument
59 debug_mutex_remove_waiter(struct mutex * lock,struct mutex_waiter * waiter,struct task_struct * task) debug_mutex_remove_waiter() argument
[all...]
H A Drtmutex.c35 static inline int __ww_mutex_add_waiter(struct rt_mutex_waiter *waiter, in __ww_mutex_add_waiter() argument
55 struct rt_mutex_waiter *waiter, in __ww_mutex_check_kill() argument
362 waiter_update_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_update_prio() argument
364 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_update_prio()
365 lockdep_assert(RB_EMPTY_NODE(&waiter->tree.entry)); in waiter_update_prio()
367 waiter->tree.prio = __waiter_prio(task); in waiter_update_prio()
368 waiter->tree.deadline = task->dl.deadline; in waiter_update_prio()
375 waiter_clone_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_clone_prio() argument
377 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_clone_prio()
379 lockdep_assert(RB_EMPTY_NODE(&waiter->pi_tree.entry)); in waiter_clone_prio()
[all …]
H A Drwsem.c368 rwsem_add_waiter(struct rw_semaphore *sem, struct rwsem_waiter *waiter) in rwsem_add_waiter() argument
371 list_add_tail(&waiter->list, &sem->wait_list); in rwsem_add_waiter()
384 rwsem_del_waiter(struct rw_semaphore *sem, struct rwsem_waiter *waiter) in rwsem_del_waiter() argument
387 list_del(&waiter->list); in rwsem_del_waiter()
413 struct rwsem_waiter *waiter, *tmp; in rwsem_mark_wake() local
423 waiter = rwsem_first_waiter(sem); in rwsem_mark_wake()
425 if (waiter->type == RWSEM_WAITING_FOR_WRITE) { in rwsem_mark_wake()
434 wake_q_add(wake_q, waiter->task); in rwsem_mark_wake()
463 if (time_after(jiffies, waiter->timeout)) { in rwsem_mark_wake()
468 waiter->handoff_set = true; in rwsem_mark_wake()
[all …]
H A Dsemaphore.c212 struct semaphore_waiter waiter; in ___down_common() local
214 list_add_tail(&waiter.list, &sem->wait_list); in ___down_common()
215 waiter.task = current; in ___down_common()
216 waiter.up = false; in ___down_common()
227 if (waiter.up) in ___down_common()
232 list_del(&waiter.list); in ___down_common()
236 list_del(&waiter.list); in ___down_common()
274 struct semaphore_waiter *waiter = list_first_entry(&sem->wait_list, in __up() local
276 list_del(&waiter->list); in __up()
277 waiter->up = true; in __up()
[all …]
H A Dww_mutex.h53 __ww_waiter_add(struct mutex *lock, struct mutex_waiter *waiter, struct mutex_waiter *pos) in __ww_waiter_add() argument
58 __mutex_add_waiter(lock, waiter, p); in __ww_waiter_add()
130 __ww_waiter_add(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct rt_mutex_waiter *pos) in __ww_waiter_add() argument
277 __ww_mutex_die(struct MUTEX *lock, struct MUTEX_WAITER *waiter, in __ww_mutex_die() argument
283 if (waiter->ww_ctx->acquired > 0 && __ww_ctx_less(waiter->ww_ctx, ww_ctx)) { in __ww_mutex_die()
285 debug_mutex_wake_waiter(lock, waiter); in __ww_mutex_die()
287 wake_q_add(wake_q, waiter->task); in __ww_mutex_die()
449 __ww_mutex_check_kill(struct MUTEX *lock, struct MUTEX_WAITER *waiter, in __ww_mutex_check_kill() argument
473 for (cur = __ww_waiter_prev(lock, waiter); cur; in __ww_mutex_check_kill()
497 __ww_mutex_add_waiter(struct MUTEX_WAITER *waiter, in __ww_mutex_add_waiter() argument
[all …]
/linux/drivers/md/dm-vdo/
H A Dadmin-state.c203 if (state->waiter != NULL) in vdo_finish_operation()
204 vdo_set_completion_result(state->waiter, result); in vdo_finish_operation()
208 if (state->waiter != NULL) in vdo_finish_operation()
209 vdo_launch_completion(vdo_forget(state->waiter)); in vdo_finish_operation()
224 struct vdo_completion *waiter, in begin_operation() argument
235 } else if (state->waiter != NULL) { in begin_operation()
240 state->waiter = waiter; in begin_operation()
254 if (waiter != NULL) in begin_operation()
255 vdo_continue_completion(waiter, result); in begin_operation()
269 struct vdo_completion *waiter, in start_operation() argument
[all …]
H A Dwait-queue.c21 void vdo_waitq_enqueue_waiter(struct vdo_wait_queue *waitq, struct vdo_waiter *waiter) in vdo_waitq_enqueue_waiter() argument
23 BUG_ON(waiter->next_waiter != NULL); in vdo_waitq_enqueue_waiter()
30 waiter->next_waiter = waiter; in vdo_waitq_enqueue_waiter()
33 waiter->next_waiter = waitq->last_waiter->next_waiter; in vdo_waitq_enqueue_waiter()
34 waitq->last_waiter->next_waiter = waiter; in vdo_waitq_enqueue_waiter()
38 waitq->last_waiter = waiter; in vdo_waitq_enqueue_waiter()
138 struct vdo_waiter *waiter = vdo_waitq_dequeue_waiter(&iteration_waitq); in vdo_waitq_dequeue_matching_waiters() local
140 vdo_waitq_enqueue_waiter((waiter_match(waiter, match_context) ? in vdo_waitq_dequeue_matching_waiters()
141 matched_waitq : waitq), waiter); in vdo_waitq_dequeue_matching_waiters()
195 struct vdo_waiter *waiter = vdo_waitq_dequeue_waiter(waitq); in vdo_waitq_notify_next_waiter() local
[all …]
H A Dwait-queue.h51 typedef void (*vdo_waiter_callback_fn)(struct vdo_waiter *waiter, void *context);
58 typedef bool (*vdo_waiter_match_fn)(struct vdo_waiter *waiter, void *context);
78 static inline bool vdo_waiter_is_waiting(struct vdo_waiter *waiter) in vdo_waiter_is_waiting() argument
80 return (waiter->next_waiter != NULL); in vdo_waiter_is_waiting()
107 struct vdo_waiter *waiter);
H A Ddump.c154 struct vdo_waiter *waiter, *first = vdo_waitq_get_first_waiter(waitq); in dump_vio_waiters() local
166 for (waiter = first->next_waiter; waiter != first; waiter = waiter->next_waiter) { in dump_vio_waiters()
167 data_vio = vdo_waiter_as_data_vio(waiter); in dump_vio_waiters()
195 if (data_vio->waiter.next_waiter != NULL) in encode_vio_dump_flags()
H A Dadmin-state.h57 struct vdo_completion *waiter; member
140 struct vdo_completion *waiter);
144 struct vdo_completion *waiter, vdo_admin_initiator_fn initiator);
152 struct vdo_completion *waiter, vdo_admin_initiator_fn initiator);
162 struct vdo_completion *waiter, vdo_admin_initiator_fn initiator);
173 struct vdo_completion *waiter,
H A Dflush.c96 static struct vdo_flush *vdo_waiter_as_flush(struct vdo_waiter *waiter) in vdo_waiter_as_flush() argument
98 return container_of(waiter, struct vdo_flush, waiter); in vdo_waiter_as_flush()
285 vdo_waitq_enqueue_waiter(&flusher->notifiers, &flush->waiter); in flush_vdo()
/linux/drivers/tty/
H A Dtty_ldsem.c76 struct ldsem_waiter *waiter, *next; in __ldsem_wake_readers() local
94 list_for_each_entry_safe(waiter, next, &sem->read_wait, list) { in __ldsem_wake_readers()
95 tsk = waiter->task; in __ldsem_wake_readers()
96 smp_store_release(&waiter->task, NULL); in __ldsem_wake_readers()
121 struct ldsem_waiter *waiter; in __ldsem_wake_writer() local
123 waiter = list_entry(sem->write_wait.next, struct ldsem_waiter, list); in __ldsem_wake_writer()
124 wake_up_process(waiter->task); in __ldsem_wake_writer()
158 struct ldsem_waiter waiter; in down_read_failed() local
180 list_add_tail(&waiter.list, &sem->read_wait); in down_read_failed()
183 waiter.task = current; in down_read_failed()
[all …]
/linux/lib/
H A Dklist.c185 struct klist_waiter *waiter, *tmp; in klist_release() local
191 list_for_each_entry_safe(waiter, tmp, &klist_remove_waiters, list) { in klist_release()
192 if (waiter->node != n) in klist_release()
195 list_del(&waiter->list); in klist_release()
196 waiter->woken = 1; in klist_release()
198 wake_up_process(waiter->process); in klist_release()
240 struct klist_waiter waiter; in klist_remove() local
242 waiter.node = n; in klist_remove()
243 waiter.process = current; in klist_remove()
244 waiter.woken = 0; in klist_remove()
[all …]
/linux/tools/testing/selftests/filesystems/epoll/
H A Depoll_wakeup_test.c23 pthread_t waiter; member
47 pthread_kill(ctx->waiter, SIGUSR1); in kill_timeout()
489 ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1a, &ctx), 0); in TEST()
495 ASSERT_EQ(pthread_join(ctx.waiter, NULL), 0); in TEST()
532 ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1a, &ctx), 0); in TEST()
538 ASSERT_EQ(pthread_join(ctx.waiter, NULL), 0); in TEST()
579 ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry2a, &ctx), 0); in TEST()
585 ASSERT_EQ(pthread_join(ctx.waiter, NULL), 0); in TEST()
628 ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1a, &ctx), 0); in TEST()
634 ASSERT_EQ(pthread_join(ctx.waiter, NULL), 0); in TEST()
[all …]
/linux/tools/testing/selftests/futex/functional/
H A Dfutex_requeue_pi_signal_restart.c122 pthread_t waiter; in main() local
158 res = create_rt_thread(&waiter, waiterfn, NULL, SCHED_FIFO, 1); in main()
177 pthread_kill(waiter, SIGUSR1); in main()
208 pthread_kill(waiter, SIGUSR1); in main()
210 pthread_join(waiter, NULL); in main()
H A Dfutex_wait.c53 pthread_t waiter; in main() local
81 if (pthread_create(&waiter, NULL, waiterfn, (void *) &flags)) in main()
109 if (pthread_create(&waiter, NULL, waiterfn, NULL)) in main()
148 if (pthread_create(&waiter, NULL, waiterfn, NULL)) in main()
H A Dfutex_requeue.c43 pthread_t waiter[10]; in main() local
76 if (pthread_create(&waiter[0], NULL, waiterfn, NULL)) in main()
108 if (pthread_create(&waiter[i], NULL, waiterfn, NULL)) in main()
H A Dfutex_waitv.c62 pthread_t waiter; in main() local
97 if (pthread_create(&waiter, NULL, waiterfn, NULL)) in main()
130 if (pthread_create(&waiter, NULL, waiterfn, NULL)) in main()
/linux/Documentation/locking/
H A Dfutex-requeue-pi.rst20 implementation would wake the highest-priority waiter, and leave the
92 The requeue code cannot simply wake the waiter and leave it to
94 requeue call returning to user space and the waiter waking and
100 of the waiter and to enqueue the waiter on a contended rt_mutex.
104 FUTEX_WAIT_REQUEUE_PI is called by the waiter (pthread_cond_wait()
116 PI futex on behalf of the top waiter. If it can, this waiter is
120 task as a waiter on the underlying rt_mutex. It is possible that
122 waiter is woken to finish the acquisition of the lock.
H A Drt-mutex-design.rst100 waiter
101 - A waiter is a struct that is stored on the stack of a blocked
102 process. Since the scope of the waiter is within the code for
104 the waiter on the process's stack (local variable). This
110 waiter is sometimes used in reference to the task that is waiting
111 on a mutex. This is the same as waiter->task.
116 top waiter
119 top pi waiter
360 pi waiter to its own normal/deadline priority and take the higher one.
377 by the task, so we only need to compare the priority of that top pi waiter
[all …]
H A Drt-mutex.rst20 priority waiter until the rt-mutex is released. If the temporarily
32 The enqueueing of the waiters into the rtmutex waiter tree is done in
34 rtmutex, only the top priority waiter is enqueued into the owner's
36 the top priority waiter of a task changes (for example it timed out or
56 NULL 1 lock is free and has waiters and the top waiter
/linux/drivers/gpu/drm/amd/amdkfd/
H A Dkfd_events.c264 struct kfd_event_waiter *waiter; in destroy_event() local
268 list_for_each_entry(waiter, &ev->wq.head, wait.entry) in destroy_event()
269 WRITE_ONCE(waiter->event, NULL); in destroy_event()
626 struct kfd_event_waiter *waiter; in set_event() local
640 list_for_each_entry(waiter, &ev->wq.head, wait.entry) in set_event()
641 WRITE_ONCE(waiter->activated, true); in set_event()
800 struct kfd_event_waiter *waiter, in init_event_waiter() argument
809 waiter->event = ev; in init_event_waiter()
810 waiter->activated = ev->signaled; in init_event_waiter()
814 if (waiter->event->type == KFD_EVENT_TYPE_SIGNAL && in init_event_waiter()
[all …]
/linux/fs/
H A Dlocks.c675 static void locks_insert_global_blocked(struct file_lock_core *waiter) in locks_insert_global_blocked() argument
679 hash_add(blocked_hash, &waiter->flc_link, posix_owner_key(waiter)); in locks_insert_global_blocked()
682 static void locks_delete_global_blocked(struct file_lock_core *waiter) in locks_delete_global_blocked() argument
686 hash_del(&waiter->flc_link); in locks_delete_global_blocked()
694 static void __locks_unlink_block(struct file_lock_core *waiter) in __locks_unlink_block() argument
696 locks_delete_global_blocked(waiter); in __locks_unlink_block()
697 list_del_init(&waiter->flc_blocked_member); in __locks_unlink_block()
703 struct file_lock_core *waiter; in __locks_wake_up_blocks() local
706 waiter = list_first_entry(&blocker->flc_blocked_requests, in __locks_wake_up_blocks()
709 fl = file_lock(waiter); in __locks_wake_up_blocks()
[all …]
/linux/drivers/md/persistent-data/
H A Ddm-block-manager.c55 struct waiter { struct
122 static void __wait(struct waiter *w) in __wait()
136 static void __wake_waiter(struct waiter *w) in __wake_waiter()
152 struct waiter *w, *tmp; in __wake_many()
196 struct waiter w; in bl_down_read()
259 struct waiter w; in bl_down_write()
/linux/fs/iomap/
H A Ddirect-io.c52 struct task_struct *waiter; member
182 struct task_struct *waiter = dio->submit.waiter; in iomap_dio_bio_end_io() local
184 WRITE_ONCE(dio->submit.waiter, NULL); in iomap_dio_bio_end_io()
185 blk_wake_io_task(waiter); in iomap_dio_bio_end_io()
608 dio->submit.waiter = current; in __iomap_dio_rw()
767 if (!READ_ONCE(dio->submit.waiter)) in __iomap_dio_rw()

123