hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/swait.h
....@@ -9,23 +9,10 @@
99 #include <asm/current.h>
1010
1111 /*
12
- * BROKEN wait-queues.
13
- *
14
- * These "simple" wait-queues are broken garbage, and should never be
15
- * used. The comments below claim that they are "similar" to regular
16
- * wait-queues, but the semantics are actually completely different, and
17
- * every single user we have ever had has been buggy (or pointless).
18
- *
19
- * A "swake_up_one()" only wakes up _one_ waiter, which is not at all what
20
- * "wake_up()" does, and has led to problems. In other cases, it has
21
- * been fine, because there's only ever one waiter (kvm), but in that
22
- * case gthe whole "simple" wait-queue is just pointless to begin with,
23
- * since there is no "queue". Use "wake_up_process()" with a direct
24
- * pointer instead.
25
- *
26
- * While these are very similar to regular wait queues (wait.h) the most
27
- * important difference is that the simple waitqueue allows for deterministic
28
- * behaviour -- IOW it has strictly bounded IRQ and lock hold times.
12
+ * Simple waitqueues are semantically very different to regular wait queues
13
+ * (wait.h). The most important difference is that the simple waitqueue allows
14
+ * for deterministic behaviour -- IOW it has strictly bounded IRQ and lock hold
15
+ * times.
2916 *
3017 * Mainly, this is accomplished by two things. Firstly not allowing swake_up_all
3118 * from IRQ disabled, and dropping the lock upon every wakeup, giving a higher
....@@ -39,7 +26,7 @@
3926 * sleeper state.
4027 *
4128 * - the !exclusive mode; because that leads to O(n) wakeups, everything is
42
- * exclusive.
29
+ * exclusive. As such swake_up_one will only ever awake _one_ waiter.
4330 *
4431 * - custom wake callback functions; because you cannot give any guarantees
4532 * about random code. This also allows swait to be used in RT, such that
....@@ -160,9 +147,7 @@
160147 extern void swake_up_one(struct swait_queue_head *q);
161148 extern void swake_up_all(struct swait_queue_head *q);
162149 extern void swake_up_locked(struct swait_queue_head *q);
163
-extern void swake_up_all_locked(struct swait_queue_head *q);
164150
165
-extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
166151 extern void prepare_to_swait_exclusive(struct swait_queue_head *q, struct swait_queue *wait, int state);
167152 extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state);
168153
....@@ -298,19 +283,5 @@
298283 condition, timeout); \
299284 __ret; \
300285 })
301
-
302
-#define __swait_event_lock_irq(wq, condition, lock, cmd) \
303
- ___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \
304
- raw_spin_unlock_irq(&lock); \
305
- cmd; \
306
- schedule(); \
307
- raw_spin_lock_irq(&lock))
308
-
309
-#define swait_event_lock_irq(wq_head, condition, lock) \
310
- do { \
311
- if (condition) \
312
- break; \
313
- __swait_event_lock_irq(wq_head, condition, lock, ); \
314
- } while (0)
315286
316287 #endif /* _LINUX_SWAIT_H */