Home
last modified time | relevance | path

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

123

/linux-6.6.21/kernel/locking/
Dmutex-debug.c28 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common() argument
30 memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter)); in debug_mutex_lock_common()
31 waiter->magic = waiter; in debug_mutex_lock_common()
32 INIT_LIST_HEAD(&waiter->list); in debug_mutex_lock_common()
33 waiter->ww_ctx = MUTEX_POISON_WW_CTX; in debug_mutex_lock_common()
36 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_wake_waiter() argument
40 DEBUG_LOCKS_WARN_ON(waiter->magic != waiter); in debug_mutex_wake_waiter()
41 DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list)); in debug_mutex_wake_waiter()
44 void debug_mutex_free_waiter(struct mutex_waiter *waiter) in debug_mutex_free_waiter() argument
46 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
340 waiter_update_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_update_prio() argument
342 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_update_prio()
343 lockdep_assert(RB_EMPTY_NODE(&waiter->tree.entry)); in waiter_update_prio()
345 waiter->tree.prio = __waiter_prio(task); in waiter_update_prio()
346 waiter->tree.deadline = task->dl.deadline; in waiter_update_prio()
353 waiter_clone_prio(struct rt_mutex_waiter *waiter, struct task_struct *task) in waiter_clone_prio() argument
355 lockdep_assert_held(&waiter->lock->wait_lock); in waiter_clone_prio()
357 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.c370 rwsem_add_waiter(struct rw_semaphore *sem, struct rwsem_waiter *waiter) in rwsem_add_waiter() argument
373 list_add_tail(&waiter->list, &sem->wait_list); in rwsem_add_waiter()
386 rwsem_del_waiter(struct rw_semaphore *sem, struct rwsem_waiter *waiter) in rwsem_del_waiter() argument
389 list_del(&waiter->list); in rwsem_del_waiter()
415 struct rwsem_waiter *waiter, *tmp; in rwsem_mark_wake() local
425 waiter = rwsem_first_waiter(sem); in rwsem_mark_wake()
427 if (waiter->type == RWSEM_WAITING_FOR_WRITE) { in rwsem_mark_wake()
436 wake_q_add(wake_q, waiter->task); in rwsem_mark_wake()
465 if (time_after(jiffies, waiter->timeout)) { in rwsem_mark_wake()
470 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.6.21/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.6.21/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.6.21/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.6.21/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()
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-6.6.21/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.
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 …]
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-6.6.21/drivers/gpu/drm/amd/amdkfd/
Dkfd_events.c263 struct kfd_event_waiter *waiter; in destroy_event() local
267 list_for_each_entry(waiter, &ev->wq.head, wait.entry) in destroy_event()
268 WRITE_ONCE(waiter->event, NULL); in destroy_event()
625 struct kfd_event_waiter *waiter; in set_event() local
639 list_for_each_entry(waiter, &ev->wq.head, wait.entry) in set_event()
640 WRITE_ONCE(waiter->activated, true); in set_event()
799 struct kfd_event_waiter *waiter, in init_event_waiter() argument
808 waiter->event = ev; in init_event_waiter()
809 waiter->activated = ev->signaled; in init_event_waiter()
813 if (waiter->event->type == KFD_EVENT_TYPE_SIGNAL && in init_event_waiter()
[all …]
/linux-6.6.21/fs/
Dlocks.c642 static void locks_insert_global_blocked(struct file_lock *waiter) in locks_insert_global_blocked() argument
646 hash_add(blocked_hash, &waiter->fl_link, posix_owner_key(waiter)); in locks_insert_global_blocked()
649 static void locks_delete_global_blocked(struct file_lock *waiter) in locks_delete_global_blocked() argument
653 hash_del(&waiter->fl_link); in locks_delete_global_blocked()
661 static void __locks_delete_block(struct file_lock *waiter) in __locks_delete_block() argument
663 locks_delete_global_blocked(waiter); in __locks_delete_block()
664 list_del_init(&waiter->fl_blocked_member); in __locks_delete_block()
670 struct file_lock *waiter; in __locks_wake_up_blocks() local
672 waiter = list_first_entry(&blocker->fl_blocked_requests, in __locks_wake_up_blocks()
674 __locks_delete_block(waiter); in __locks_wake_up_blocks()
[all …]
/linux-6.6.21/drivers/staging/vc04_services/interface/vchiq_arm/
Dvchiq_dev.c292 struct bulk_waiter_node *waiter = NULL, *iter; in vchiq_irq_queue_bulk_tx_rx() local
302 waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); in vchiq_irq_queue_bulk_tx_rx()
303 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
308 userdata = &waiter->bulk_waiter; in vchiq_irq_queue_bulk_tx_rx()
315 waiter = iter; in vchiq_irq_queue_bulk_tx_rx()
320 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
327 "found bulk_waiter %pK for pid %d", waiter, current->pid); in vchiq_irq_queue_bulk_tx_rx()
328 userdata = &waiter->bulk_waiter; in vchiq_irq_queue_bulk_tx_rx()
336 if (!waiter) { in vchiq_irq_queue_bulk_tx_rx()
342 !waiter->bulk_waiter.bulk) { in vchiq_irq_queue_bulk_tx_rx()
[all …]
Dvchiq_arm.c720 struct bulk_waiter_node *waiter, *next; in free_bulk_waiter() local
722 list_for_each_entry_safe(waiter, next, in free_bulk_waiter()
724 list_del(&waiter->list); in free_bulk_waiter()
726 waiter, waiter->pid); in free_bulk_waiter()
727 kfree(waiter); in free_bulk_waiter()
925 struct bulk_waiter_node *waiter = NULL, *iter; in vchiq_blocking_bulk_transfer() local
937 waiter = iter; in vchiq_blocking_bulk_transfer()
943 if (waiter) { in vchiq_blocking_bulk_transfer()
944 struct vchiq_bulk *bulk = waiter->bulk_waiter.bulk; in vchiq_blocking_bulk_transfer()
960 waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); in vchiq_blocking_bulk_transfer()
[all …]
/linux-6.6.21/drivers/md/persistent-data/
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-6.6.21/fs/iomap/
Ddirect-io.c45 struct task_struct *waiter; member
175 struct task_struct *waiter = dio->submit.waiter; in iomap_dio_bio_end_io() local
177 WRITE_ONCE(dio->submit.waiter, NULL); in iomap_dio_bio_end_io()
178 blk_wake_io_task(waiter); in iomap_dio_bio_end_io()
577 dio->submit.waiter = current; in __iomap_dio_rw()
723 if (!READ_ONCE(dio->submit.waiter)) in __iomap_dio_rw()

123