hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/kernel/sched/swait.c
....@@ -32,6 +32,19 @@
3232 }
3333 EXPORT_SYMBOL(swake_up_locked);
3434
35
+/*
36
+ * Wake up all waiters. This is an interface which is solely exposed for
37
+ * completions and not for general usage.
38
+ *
39
+ * It is intentionally different from swake_up_all() to allow usage from
40
+ * hard interrupt context and interrupt disabled regions.
41
+ */
42
+void swake_up_all_locked(struct swait_queue_head *q)
43
+{
44
+ while (!list_empty(&q->task_list))
45
+ swake_up_locked(q);
46
+}
47
+
3548 void swake_up_one(struct swait_queue_head *q)
3649 {
3750 unsigned long flags;
....@@ -69,7 +82,7 @@
6982 }
7083 EXPORT_SYMBOL(swake_up_all);
7184
72
-static void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait)
85
+void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait)
7386 {
7487 wait->task = current;
7588 if (list_empty(&wait->task_list))
....@@ -93,7 +106,7 @@
93106 long ret = 0;
94107
95108 raw_spin_lock_irqsave(&q->lock, flags);
96
- if (unlikely(signal_pending_state(state, current))) {
109
+ if (signal_pending_state(state, current)) {
97110 /*
98111 * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one()
99112 * must not see us.