Commit 0476ff2c authored by Thomas Gleixner's avatar Thomas Gleixner

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: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192920.639878168@linutronix.de
parent 8c2d74f0
...@@ -785,9 +785,9 @@ static inline void check_dl_overrun(struct task_struct *tsk) ...@@ -785,9 +785,9 @@ static inline void check_dl_overrun(struct task_struct *tsk)
static void check_thread_timers(struct task_struct *tsk, static void check_thread_timers(struct task_struct *tsk,
struct list_head *firing) struct list_head *firing)
{ {
struct list_head *timers = tsk->cpu_timers;
struct task_cputime *tsk_expires = &tsk->cputime_expires; struct task_cputime *tsk_expires = &tsk->cputime_expires;
u64 expires; struct list_head *timers = tsk->cpu_timers;
u64 expires, stime, utime;
unsigned long soft; unsigned long soft;
if (dl_task(tsk)) if (dl_task(tsk))
...@@ -800,10 +800,12 @@ static void check_thread_timers(struct task_struct *tsk, ...@@ -800,10 +800,12 @@ static void check_thread_timers(struct task_struct *tsk,
if (task_cputime_zero(&tsk->cputime_expires)) if (task_cputime_zero(&tsk->cputime_expires))
return; 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; 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->virt_exp = expires;
tsk_expires->sched_exp = check_timers_list(++timers, firing, tsk_expires->sched_exp = check_timers_list(++timers, firing,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment