hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/sched/cputime.h
....@@ -61,8 +61,7 @@
6161 * Thread group CPU time accounting.
6262 */
6363 void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
64
-void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
65
-
64
+void thread_group_sample_cputime(struct task_struct *tsk, u64 *samples);
6665
6766 /*
6867 * The following are functions that support scheduler-internal time accounting.
....@@ -71,7 +70,7 @@
7170 */
7271
7372 /**
74
- * get_running_cputimer - return &tsk->signal->cputimer if cputimer is running
73
+ * get_running_cputimer - return &tsk->signal->cputimer if cputimers are active
7574 *
7675 * @tsk: Pointer to target task.
7776 */
....@@ -81,8 +80,11 @@
8180 {
8281 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
8382
84
- /* Check if cputimer isn't running. This is accessed without locking. */
85
- if (!READ_ONCE(cputimer->running))
83
+ /*
84
+ * Check whether posix CPU timers are active. If not the thread
85
+ * group accounting is not active either. Lockless check.
86
+ */
87
+ if (!READ_ONCE(tsk->signal->posix_cputimers.timers_active))
8688 return NULL;
8789
8890 /*