From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 02:45:28 +0000
Subject: [PATCH] add boot partition  size

---
 kernel/include/linux/sched/wake_q.h |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/kernel/include/linux/sched/wake_q.h b/kernel/include/linux/sched/wake_q.h
index 1c4438f..b1bdbb6 100644
--- a/kernel/include/linux/sched/wake_q.h
+++ b/kernel/include/linux/sched/wake_q.h
@@ -24,9 +24,13 @@
  * called near the end of a function. Otherwise, the list can be
  * re-initialized for later re-use by wake_q_init().
  *
- * Note that this can cause spurious wakeups. schedule() callers
+ * NOTE that this can cause spurious wakeups. schedule() callers
  * must ensure the call is done inside a loop, confirming that the
  * wakeup condition has in fact occurred.
+ *
+ * NOTE that there is no guarantee the wakeup will happen any later than the
+ * wake_q_add() location. Therefore task must be ready to be woken at the
+ * location of the wake_q_add().
  */
 
 #include <linux/sched.h>
@@ -49,21 +53,16 @@
 	head->count = 0;
 }
 
-extern void __wake_q_add(struct wake_q_head *head,
-			 struct task_struct *task, bool sleeper);
-static inline void wake_q_add(struct wake_q_head *head,
-			      struct task_struct *task)
+static inline bool wake_q_empty(struct wake_q_head *head)
 {
-	__wake_q_add(head, task, false);
+	return head->first == WAKE_Q_TAIL;
 }
 
-static inline void wake_q_add_sleeper(struct wake_q_head *head,
-				      struct task_struct *task)
-{
-	__wake_q_add(head, task, true);
-}
-
+extern void wake_q_add(struct wake_q_head *head, struct task_struct *task);
+extern void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task);
+extern void wake_q_add_sleeper(struct wake_q_head *head, struct task_struct *task);
 extern void __wake_up_q(struct wake_q_head *head, bool sleeper);
+
 static inline void wake_up_q(struct wake_q_head *head)
 {
 	__wake_up_q(head, false);

--
Gitblit v1.6.2