[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-715eb7a9243a058a0722aa2f6ba703ede9113e76@git.kernel.org>
Date: Wed, 1 Feb 2017 01:58:31 -0800
From: tip-bot for Frederic Weisbecker <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: paulus@...ba.org, torvalds@...ux-foundation.org, riel@...hat.com,
tglx@...utronix.de, heiko.carstens@...ibm.com,
fenghua.yu@...el.com, tony.luck@...el.com,
linux-kernel@...r.kernel.org, peterz@...radead.org, hpa@...or.com,
sgruszka@...hat.com, fweisbec@...il.com, mpe@...erman.id.au,
schwidefsky@...ibm.com, benh@...nel.crashing.org,
wanpeng.li@...mail.com, mingo@...nel.org
Subject: [tip:sched/core] timers/posix-timers: Use TICK_NSEC instead of a
dynamically ad-hoc calculated version
Commit-ID: 715eb7a9243a058a0722aa2f6ba703ede9113e76
Gitweb: http://git.kernel.org/tip/715eb7a9243a058a0722aa2f6ba703ede9113e76
Author: Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Tue, 31 Jan 2017 04:09:33 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 1 Feb 2017 09:13:54 +0100
timers/posix-timers: Use TICK_NSEC instead of a dynamically ad-hoc calculated version
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Cc: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: Stanislaw Gruszka <sgruszka@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tony Luck <tony.luck@...el.com>
Cc: Wanpeng Li <wanpeng.li@...mail.com>
Link: http://lkml.kernel.org/r/1485832191-26889-18-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/time/posix-cpu-timers.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index d53ff71..8349e02 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -890,8 +890,6 @@ static inline void stop_process_timers(struct signal_struct *sig)
tick_dep_clear_signal(sig, TICK_DEP_BIT_POSIX_TIMER);
}
-static u32 onecputick;
-
static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
unsigned long long *expires,
unsigned long long cur_time, int signo)
@@ -903,9 +901,9 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
if (it->incr) {
it->expires += it->incr;
it->error += it->incr_error;
- if (it->error >= onecputick) {
+ if (it->error >= TICK_NSEC) {
it->expires -= cputime_one_jiffy;
- it->error -= onecputick;
+ it->error -= TICK_NSEC;
}
} else {
it->expires = 0;
@@ -1476,15 +1474,10 @@ static __init int init_posix_cpu_timers(void)
.clock_get = thread_cpu_clock_get,
.timer_create = thread_cpu_timer_create,
};
- struct timespec ts;
posix_timers_register_clock(CLOCK_PROCESS_CPUTIME_ID, &process);
posix_timers_register_clock(CLOCK_THREAD_CPUTIME_ID, &thread);
- cputime_to_timespec(cputime_one_jiffy, &ts);
- onecputick = ts.tv_nsec;
- WARN_ON(ts.tv_sec != 0);
-
return 0;
}
__initcall(init_posix_cpu_timers);
Powered by blists - more mailing lists