itimers: Use quick sample function
authorThomas Gleixner <tglx@linutronix.de>
Wed, 21 Aug 2019 19:08:52 +0000 (21:08 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 28 Aug 2019 09:50:26 +0000 (11:50 +0200)
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
kernel/time/itimer.c

index 9d26fd4ba4c0f43b3ff9da0cba414462d4086a60..ae04bc259240d2576a6fb91b91b137f685d8b7a1 100644 (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