diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-08-21 22:09:02 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-08-28 12:50:32 +0300 |
commit | 0476ff2c151ee35bda2f938e8828b6f6113ebf55 (patch) | |
tree | ed48c616e46a1f4846f986c53554ecf2cd525768 /kernel/time | |
parent | 8c2d74f03705c2c993a57673bae8fd535eabede6 (diff) | |
download | linux-0476ff2c151ee35bda2f938e8828b6f6113ebf55.tar.xz |
posix-cpu-timers: Sample task times once in expiry check
Sampling the task times twice does not make sense. Do it once.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192920.639878168@linutronix.de
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/posix-cpu-timers.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index a2007ce9322a..98dab3e4be08 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -785,9 +785,9 @@ static inline void check_dl_overrun(struct task_struct *tsk) static void check_thread_timers(struct task_struct *tsk, struct list_head *firing) { - struct list_head *timers = tsk->cpu_timers; struct task_cputime *tsk_expires = &tsk->cputime_expires; - u64 expires; + struct list_head *timers = tsk->cpu_timers; + u64 expires, stime, utime; unsigned long soft; if (dl_task(tsk)) @@ -800,10 +800,12 @@ static void check_thread_timers(struct task_struct *tsk, if (task_cputime_zero(&tsk->cputime_expires)) return; - expires = check_timers_list(timers, firing, prof_ticks(tsk)); + task_cputime(tsk, &utime, &stime); + + expires = check_timers_list(timers, firing, utime + stime); tsk_expires->prof_exp = expires; - expires = check_timers_list(++timers, firing, virt_ticks(tsk)); + expires = check_timers_list(++timers, firing, utime); tsk_expires->virt_exp = expires; tsk_expires->sched_exp = check_timers_list(++timers, firing, |