Lines Matching refs:wq_head
9 void __init_waitqueue_head(struct wait_queue_head *wq_head, const char *name, struct lock_class_key… in __init_waitqueue_head() argument
11 spin_lock_init(&wq_head->lock); in __init_waitqueue_head()
12 lockdep_set_class_and_name(&wq_head->lock, key, name); in __init_waitqueue_head()
13 INIT_LIST_HEAD(&wq_head->head); in __init_waitqueue_head()
18 void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue() argument
23 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue()
24 __add_wait_queue(wq_head, wq_entry); in add_wait_queue()
25 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue()
29 void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_exclusive() argument
34 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue_exclusive()
35 __add_wait_queue_entry_tail(wq_head, wq_entry); in add_wait_queue_exclusive()
36 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue_exclusive()
40 void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_priority() argument
45 spin_lock_irqsave(&wq_head->lock, flags); in add_wait_queue_priority()
46 __add_wait_queue(wq_head, wq_entry); in add_wait_queue_priority()
47 spin_unlock_irqrestore(&wq_head->lock, flags); in add_wait_queue_priority()
51 void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in remove_wait_queue() argument
55 spin_lock_irqsave(&wq_head->lock, flags); in remove_wait_queue()
56 __remove_wait_queue(wq_head, wq_entry); in remove_wait_queue()
57 spin_unlock_irqrestore(&wq_head->lock, flags); in remove_wait_queue()
81 static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up_common() argument
88 lockdep_assert_held(&wq_head->lock); in __wake_up_common()
96 curr = list_first_entry(&wq_head->head, wait_queue_entry_t, entry); in __wake_up_common()
98 if (&curr->entry == &wq_head->head) in __wake_up_common()
101 list_for_each_entry_safe_from(curr, next, &wq_head->head, entry) { in __wake_up_common()
115 (&next->entry != &wq_head->head)) { in __wake_up_common()
125 static void __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 nr_exclusive = __wake_up_common(wq_head, mode, nr_exclusive, in __wake_up_common_lock()
140 spin_unlock_irqrestore(&wq_head->lock, flags); in __wake_up_common_lock()
154 void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up() argument
157 __wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); in __wake_up()
164 void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr) in __wake_up_locked() argument
166 __wake_up_common(wq_head, mode, nr, 0, NULL, NULL); in __wake_up_locked()
170 void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key) in __wake_up_locked_key() argument
172 __wake_up_common(wq_head, mode, 1, 0, key, NULL); in __wake_up_locked_key()
176 void __wake_up_locked_key_bookmark(struct wait_queue_head *wq_head, in __wake_up_locked_key_bookmark() argument
179 __wake_up_common(wq_head, mode, 1, 0, key, bookmark); in __wake_up_locked_key_bookmark()
199 void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, in __wake_up_sync_key() argument
202 if (unlikely(!wq_head)) in __wake_up_sync_key()
205 __wake_up_common_lock(wq_head, mode, 1, WF_SYNC, key); in __wake_up_sync_key()
225 void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, in __wake_up_locked_sync_key() argument
228 __wake_up_common(wq_head, mode, 1, WF_SYNC, key, NULL); in __wake_up_locked_sync_key()
235 void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode) in __wake_up_sync() argument
237 __wake_up_sync_key(wq_head, mode, NULL); in __wake_up_sync()
254 prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) in prepare_to_wait() argument
259 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait()
261 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait()
263 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait()
269 prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int s… in prepare_to_wait_exclusive() argument
275 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait_exclusive()
277 was_empty = list_empty(&wq_head->head); in prepare_to_wait_exclusive()
278 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_exclusive()
281 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait_exclusive()
295 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int … in prepare_to_wait_event() argument
300 spin_lock_irqsave(&wq_head->lock, flags); in prepare_to_wait_event()
319 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_event()
321 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait_event()
325 spin_unlock_irqrestore(&wq_head->lock, flags); in prepare_to_wait_event()
381 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in finish_wait() argument
400 spin_lock_irqsave(&wq_head->lock, flags); in finish_wait()
402 spin_unlock_irqrestore(&wq_head->lock, flags); in finish_wait()