hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/freezer.h
....@@ -27,6 +27,11 @@
2727 return p->flags & PF_FROZEN;
2828 }
2929
30
+static inline bool frozen_or_skipped(struct task_struct *p)
31
+{
32
+ return p->flags & (PF_FROZEN | PF_FREEZER_SKIP);
33
+}
34
+
3035 extern bool freezing_slow_path(struct task_struct *p);
3136
3237 /*
....@@ -207,6 +212,17 @@
207212 return __retval;
208213 }
209214
215
+/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
216
+static inline long freezable_schedule_timeout_interruptible_unsafe(long timeout)
217
+{
218
+ long __retval;
219
+
220
+ freezer_do_not_count();
221
+ __retval = schedule_timeout_interruptible(timeout);
222
+ freezer_count_unsafe();
223
+ return __retval;
224
+}
225
+
210226 /* Like schedule_timeout_killable(), but should not block the freezer. */
211227 static inline long freezable_schedule_timeout_killable(long timeout)
212228 {
....@@ -259,6 +275,7 @@
259275
260276 #else /* !CONFIG_FREEZER */
261277 static inline bool frozen(struct task_struct *p) { return false; }
278
+static inline bool frozen_or_skipped(struct task_struct *p) { return false; }
262279 static inline bool freezing(struct task_struct *p) { return false; }
263280 static inline void __thaw_task(struct task_struct *t) {}
264281
....@@ -285,6 +302,9 @@
285302 #define freezable_schedule_timeout_interruptible(timeout) \
286303 schedule_timeout_interruptible(timeout)
287304
305
+#define freezable_schedule_timeout_interruptible_unsafe(timeout) \
306
+ schedule_timeout_interruptible(timeout)
307
+
288308 #define freezable_schedule_timeout_killable(timeout) \
289309 schedule_timeout_killable(timeout)
290310