aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched/cputime.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched/cputime.h')
-rw-r--r--include/linux/sched/cputime.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/sched/cputime.h b/include/linux/sched/cputime.h
index 53f883f5a2fd..6c9f19a33865 100644
--- a/include/linux/sched/cputime.h
+++ b/include/linux/sched/cputime.h
@@ -61,8 +61,7 @@ extern void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
61 * Thread group CPU time accounting. 61 * Thread group CPU time accounting.
62 */ 62 */
63void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); 63void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
64void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); 64void thread_group_sample_cputime(struct task_struct *tsk, u64 *samples);
65
66 65
67/* 66/*
68 * The following are functions that support scheduler-internal time accounting. 67 * The following are functions that support scheduler-internal time accounting.
@@ -71,7 +70,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
71 */ 70 */
72 71
73/** 72/**
74 * get_running_cputimer - return &tsk->signal->cputimer if cputimer is running 73 * get_running_cputimer - return &tsk->signal->cputimer if cputimers are active
75 * 74 *
76 * @tsk: Pointer to target task. 75 * @tsk: Pointer to target task.
77 */ 76 */
@@ -81,8 +80,11 @@ struct thread_group_cputimer *get_running_cputimer(struct task_struct *tsk)
81{ 80{
82 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer; 81 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
83 82
84 /* Check if cputimer isn't running. This is accessed without locking. */ 83 /*
85 if (!READ_ONCE(cputimer->running)) 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))
86 return NULL; 88 return NULL;
87 89
88 /* 90 /*