hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
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