hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/kernel.h
....@@ -204,7 +204,6 @@
204204 extern void ___might_sleep(const char *file, int line, int preempt_offset);
205205 extern void __might_sleep(const char *file, int line, int preempt_offset);
206206 extern void __cant_sleep(const char *file, int line, int preempt_offset);
207
-extern void __cant_migrate(const char *file, int line);
208207
209208 /**
210209 * might_sleep - annotation for functions that can sleep
....@@ -220,10 +219,6 @@
220219 */
221220 # define might_sleep() \
222221 do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
223
-
224
-# define might_sleep_no_state_check() \
225
- do { ___might_sleep(__FILE__, __LINE__, 0); } while (0)
226
-
227222 /**
228223 * cant_sleep - annotation for functions that cannot sleep
229224 *
....@@ -232,18 +227,6 @@
232227 # define cant_sleep() \
233228 do { __cant_sleep(__FILE__, __LINE__, 0); } while (0)
234229 # define sched_annotate_sleep() (current->task_state_change = 0)
235
-
236
-/**
237
- * cant_migrate - annotation for functions that cannot migrate
238
- *
239
- * Will print a stack trace if executed in code which is migratable
240
- */
241
-# define cant_migrate() \
242
- do { \
243
- if (IS_ENABLED(CONFIG_SMP)) \
244
- __cant_migrate(__FILE__, __LINE__); \
245
- } while (0)
246
-
247230 /**
248231 * non_block_start - annotate the start of section where sleeping is prohibited
249232 *
....@@ -267,9 +250,7 @@
267250 static inline void __might_sleep(const char *file, int line,
268251 int preempt_offset) { }
269252 # define might_sleep() do { might_resched(); } while (0)
270
-# define might_sleep_no_state_check() do { might_resched(); } while (0)
271253 # define cant_sleep() do { } while (0)
272
-# define cant_migrate() do { } while (0)
273254 # define sched_annotate_sleep() do { } while (0)
274255 # define non_block_start() do { } while (0)
275256 # define non_block_end() do { } while (0)
....@@ -277,6 +258,13 @@
277258
278259 #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
279260
261
+#ifndef CONFIG_PREEMPT_RT
262
+# define cant_migrate() cant_sleep()
263
+#else
264
+ /* Placeholder for now */
265
+# define cant_migrate() do { } while (0)
266
+#endif
267
+
280268 /**
281269 * abs - return absolute value of an argument
282270 * @x: the value. If it is unsigned type, it is converted to signed type first.