hc
2023-11-22 f743a7adbd6e230d66a6206fa115b59fec2d88eb
kernel/include/linux/sched/task.h
....@@ -90,6 +90,15 @@
9090
9191 #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
9292
93
+#ifdef CONFIG_PREEMPT_RT_BASE
94
+extern void __put_task_struct_cb(struct rcu_head *rhp);
95
+
96
+static inline void put_task_struct(struct task_struct *t)
97
+{
98
+ if (atomic_dec_and_test(&t->usage))
99
+ call_rcu(&t->put_rcu, __put_task_struct_cb);
100
+}
101
+#else
93102 extern void __put_task_struct(struct task_struct *t);
94103
95104 static inline void put_task_struct(struct task_struct *t)
....@@ -97,7 +106,7 @@
97106 if (atomic_dec_and_test(&t->usage))
98107 __put_task_struct(t);
99108 }
100
-
109
+#endif
101110 struct task_struct *task_rcu_dereference(struct task_struct **ptask);
102111
103112 #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT