[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190819143803.479479115@linutronix.de>
Date: Mon, 19 Aug 2019 16:32:03 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Oleg Nesterov <oleg@...hat.com>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
John Stultz <john.stultz@...aro.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Anna-Maria Behnsen <anna-maria@...utronix.de>
Subject: [patch 22/44] 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@...utronix.de>
---
kernel/time/posix-cpu-timers.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -785,9 +785,9 @@ static inline void check_dl_overrun(stru
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 t
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,
Powered by blists - more mailing lists