Home
last modified time | relevance | path

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

123

/linux-6.12.1/kernel/locking/
Dmutex-debug.c29 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common() argument
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() 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()
[all …]
Drtmutex.c35 static inline int __ww_mutex_add_waiter(struct rt_mutex_waiter *waiter, in __ww_mutex_add_waiter() argument
53 struct rt_mutex_waiter *waiter, in __ww_mutex_check_kill() argument
360 waiter_update_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_update_prio() argument
362 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_update_prio()
363 lockdep_assert(RB_EMPTY_NODE(&waiter->tree.entry)); in waiter_update_prio()
365 waiter->tree.prio = __waiter_prio(task); in waiter_update_prio()
366 waiter->tree.deadline = task->dl.deadline; in waiter_update_prio()
373 waiter_clone_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_clone_prio() argument
375 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_clone_prio()
377 lockdep_assert(RB_EMPTY_NODE(&waiter->pi_tree.entry)); in waiter_clone_prio()
[all …]
Drtmutex_common.h85 struct rt_mutex_waiter *waiter,
88 struct rt_mutex_waiter *waiter,
92 struct rt_mutex_waiter *waiter);
94 struct rt_mutex_waiter *waiter);
121 struct rt_mutex_waiter *waiter) in rt_mutex_waiter_is_top_waiter() argument
125 return rb_entry(leftmost, struct rt_mutex_waiter, tree.entry) == waiter; in rt_mutex_waiter_is_top_waiter()
199 static inline void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter) in debug_rt_mutex_init_waiter() argument
202 memset(waiter, 0x11, sizeof(*waiter)); in debug_rt_mutex_init_waiter()
205 static inline void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter) in debug_rt_mutex_free_waiter() argument
208 memset(waiter, 0x22, sizeof(*waiter)); in debug_rt_mutex_free_waiter()
[all …]
Dmutex.h25 struct mutex_waiter *waiter);
27 struct mutex_waiter *waiter);
28 extern void debug_mutex_free_waiter(struct mutex_waiter *waiter);
30 struct mutex_waiter *waiter,
32 extern void debug_mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
38 # define debug_mutex_lock_common(lock, waiter) do { } while (0) argument
39 # define debug_mutex_wake_waiter(lock, waiter) do { } while (0) argument
40 # define debug_mutex_free_waiter(waiter) do { } while (0) argument
41 # define debug_mutex_add_waiter(lock, waiter, ti) do { } while (0) argument
42 # define debug_mutex_remove_waiter(lock, waiter, ti) do { } while (0) argument
Dmutex.c195 static inline bool __mutex_waiter_is_first(struct mutex *lock, struct mutex_waiter *waiter) in __mutex_waiter_is_first() argument
197 return list_first_entry(&lock->wait_list, struct mutex_waiter, list) == waiter; in __mutex_waiter_is_first()
205 __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, in __mutex_add_waiter() argument
208 debug_mutex_add_waiter(lock, waiter, current); in __mutex_add_waiter()
210 list_add_tail(&waiter->list, list); in __mutex_add_waiter()
211 if (__mutex_waiter_is_first(lock, waiter)) in __mutex_add_waiter()
216 __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter) in __mutex_remove_waiter() argument
218 list_del(&waiter->list); in __mutex_remove_waiter()
222 debug_mutex_remove_waiter(lock, waiter, current); in __mutex_remove_waiter()
305 struct mutex_waiter *waiter) in ww_mutex_spin_on_owner() argument
[all …]
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 …]
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 …]
Drtmutex_api.c293 struct rt_mutex_waiter *waiter, in __rt_mutex_start_proxy_lock() argument
304 ret = task_blocks_on_rt_mutex(lock, waiter, task, NULL, in __rt_mutex_start_proxy_lock()
340 struct rt_mutex_waiter *waiter, in rt_mutex_start_proxy_lock() argument
346 ret = __rt_mutex_start_proxy_lock(lock, waiter, task); in rt_mutex_start_proxy_lock()
348 remove_waiter(lock, waiter); in rt_mutex_start_proxy_lock()
373 struct rt_mutex_waiter *waiter) in rt_mutex_wait_proxy_lock() argument
380 ret = rt_mutex_slowlock_block(lock, NULL, TASK_INTERRUPTIBLE, to, waiter); in rt_mutex_wait_proxy_lock()
412 struct rt_mutex_waiter *waiter) in rt_mutex_cleanup_proxy_lock() argument
428 try_to_take_rt_mutex(lock, current, waiter); in rt_mutex_cleanup_proxy_lock()
434 remove_waiter(lock, waiter); in rt_mutex_cleanup_proxy_lock()
[all …]
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_up_process(waiter->task); in __ww_mutex_die()
441 __ww_mutex_check_kill(struct MUTEX *lock, struct MUTEX_WAITER *waiter, in __ww_mutex_check_kill() argument
465 for (cur = __ww_waiter_prev(lock, waiter); cur; in __ww_mutex_check_kill()
489 __ww_mutex_add_waiter(struct MUTEX_WAITER *waiter, in __ww_mutex_add_waiter() argument
[all …]
/linux-6.12.1/drivers/md/dm-vdo/
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 …]
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 …]
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);
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,
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()
Dblock-map.c88 struct vdo_waiter waiter; member
163 static inline struct vdo_page_completion *page_completion_from_waiter(struct vdo_waiter *waiter) in page_completion_from_waiter() argument
167 if (waiter == NULL) in page_completion_from_waiter()
170 completion = container_of(waiter, struct vdo_page_completion, waiter); in page_completion_from_waiter()
507 static void complete_waiter_with_error(struct vdo_waiter *waiter, void *result_ptr) in complete_waiter_with_error() argument
511 vdo_fail_completion(&page_completion_from_waiter(waiter)->completion, *result); in complete_waiter_with_error()
521 static void complete_waiter_with_page(struct vdo_waiter *waiter, void *page_info) in complete_waiter_with_page() argument
523 complete_with_page(page_info, page_completion_from_waiter(waiter)); in complete_waiter_with_page()
875 static bool completion_needs_page(struct vdo_waiter *waiter, void *context) in completion_needs_page() argument
879 return (page_completion_from_waiter(waiter)->pbn == *pbn); in completion_needs_page()
[all …]
/linux-6.12.1/drivers/tty/
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-6.12.1/lib/
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-6.12.1/tools/testing/selftests/filesystems/epoll/
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-6.12.1/tools/testing/selftests/futex/functional/
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()
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()
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()
/linux-6.12.1/Documentation/locking/
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.
/linux-6.12.1/drivers/gpu/drm/amd/amdkfd/
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-6.12.1/drivers/staging/vc04_services/interface/vchiq_arm/
Dvchiq_dev.c290 struct bulk_waiter_node *waiter = NULL, *iter; in vchiq_irq_queue_bulk_tx_rx() local
300 waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); in vchiq_irq_queue_bulk_tx_rx()
301 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
306 userdata = &waiter->bulk_waiter; in vchiq_irq_queue_bulk_tx_rx()
318 waiter = iter; in vchiq_irq_queue_bulk_tx_rx()
323 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
330 waiter, current->pid); in vchiq_irq_queue_bulk_tx_rx()
331 userdata = &waiter->bulk_waiter; in vchiq_irq_queue_bulk_tx_rx()
343 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
349 !waiter->bulk_waiter.bulk) { in vchiq_irq_queue_bulk_tx_rx()
[all …]
/linux-6.12.1/fs/
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 …]

123