itimers: Use quick sample function

get_itimer() locks sighand lock and checks whether the timer is already
expired. If it is not expired then the thread group cputime accounting is
already enabled. Use the sampling function not the one which is meant for
starting a timer.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192919.689713638@linutronix.de
This commit is contained in:
Thomas Gleixner 2019-08-21 21:08:52 +02:00
parent 19298fbf45
commit a34360d424
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ static void get_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
struct task_cputime cputime;
u64 t;
thread_group_cputimer(tsk, &cputime);
thread_group_sample_cputime(tsk, &cputime);
if (clock_id == CPUCLOCK_PROF)
t = cputime.utime + cputime.stime;
else