Lines Matching refs:wq_head
8 void __init_waitqueue_head(struct wait_queue_head *wq_head, const char *name, struct lock_class_key… in __init_waitqueue_head() argument
10 spin_lock_init(&wq_head->lock); in __init_waitqueue_head()
11 lockdep_set_class_and_name(&wq_head->lock, key, name); in __init_waitqueue_head()
12 INIT_LIST_HEAD(&wq_head->head); in __init_waitqueue_head()
17 void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue() argument
22 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue()
23 __add_wait_queue(wq_head, wq_entry); in add_wait_queue()
24 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue()
28 void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_exclusive() argument
33 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue_exclusive()
34 __add_wait_queue_entry_tail(wq_head, wq_entry); in add_wait_queue_exclusive()
35 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue_exclusive()
39 void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_priority() argument
44 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue_priority()
45 __add_wait_queue(wq_head, wq_entry); in add_wait_queue_priority()
46 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue_priority()
50 void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in remove_wait_queue() argument
54 spin_lock_irqsave(&wq_head->lock, flags); in remove_wait_queue()
55 __remove_wait_queue(wq_head, wq_entry); in remove_wait_queue()
56 spin_unlock_irqrestore(&wq_head->lock, flags); in remove_wait_queue()
80 static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up_common() argument
87 lockdep_assert_held(&wq_head->lock); in __wake_up_common()
95 curr = list_first_entry(&wq_head->head, wait_queue_entry_t, entry); in __wake_up_common()
97 if (&curr->entry == &wq_head->head) in __wake_up_common()
100 list_for_each_entry_safe_from(curr, next, &wq_head->head, entry) { in __wake_up_common()
114 (&next->entry != &wq_head->head)) { in __wake_up_common()
124 static int __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up_common_lock() argument
137 spin_lock_irqsave(&wq_head->lock, flags); in __wake_up_common_lock()
138 remaining = __wake_up_common(wq_head, mode, remaining, in __wake_up_common_lock()
140 spin_unlock_irqrestore(&wq_head->lock, flags); in __wake_up_common_lock()
157 int __wake_up(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up() argument
160 return __wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); in __wake_up()
164 void __wake_up_on_current_cpu(struct wait_queue_head *wq_head, unsigned int mode, void *key) in __wake_up_on_current_cpu() argument
166 __wake_up_common_lock(wq_head, mode, 1, WF_CURRENT_CPU, key); in __wake_up_on_current_cpu()
172 void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr) in __wake_up_locked() argument
174 __wake_up_common(wq_head, mode, nr, 0, NULL, NULL); in __wake_up_locked()
178 void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key) in __wake_up_locked_key() argument
180 __wake_up_common(wq_head, mode, 1, 0, key, NULL); in __wake_up_locked_key()
184 void __wake_up_locked_key_bookmark(struct wait_queue_head *wq_head, in __wake_up_locked_key_bookmark() argument
187 __wake_up_common(wq_head, mode, 1, 0, key, bookmark); in __wake_up_locked_key_bookmark()
207 void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up_sync_key() argument
210 if (unlikely(!wq_head)) in __wake_up_sync_key()
213 __wake_up_common_lock(wq_head, mode, 1, WF_SYNC, key); in __wake_up_sync_key()
233 void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, in __wake_up_locked_sync_key() argument
236 __wake_up_common(wq_head, mode, 1, WF_SYNC, key, NULL); in __wake_up_locked_sync_key()
243 void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode) in __wake_up_sync() argument
245 __wake_up_sync_key(wq_head, mode, NULL); in __wake_up_sync()
249 void __wake_up_pollfree(struct wait_queue_head *wq_head) in __wake_up_pollfree() argument
251 __wake_up(wq_head, TASK_NORMAL, 0, poll_to_key(EPOLLHUP | POLLFREE)); in __wake_up_pollfree()
253 WARN_ON_ONCE(waitqueue_active(wq_head)); in __wake_up_pollfree()
269 prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) in prepare_to_wait() argument
274 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait()
276 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait()
278 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait()
284 prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int s… in prepare_to_wait_exclusive() argument
290 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait_exclusive()
292 was_empty = list_empty(&wq_head->head); in prepare_to_wait_exclusive()
293 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_exclusive()
296 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait_exclusive()
310 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int … in prepare_to_wait_event() argument
315 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait_event()
334 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_event()
336 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait_event()
340 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait_event()
396 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in finish_wait() argument
415 spin_lock_irqsave(&wq_head->lock, flags); in finish_wait()
417 spin_unlock_irqrestore(&wq_head->lock, flags); in finish_wait()