Commit 715eb7a9 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

timers/posix-timers: Use TICK_NSEC instead of a dynamically ad-hoc calculated version

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Link: http://lkml.kernel.org/r/1485832191-26889-18-git-send-email-fweisbec@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent a499a5a1
...@@ -890,8 +890,6 @@ static inline void stop_process_timers(struct signal_struct *sig) ...@@ -890,8 +890,6 @@ static inline void stop_process_timers(struct signal_struct *sig)
tick_dep_clear_signal(sig, TICK_DEP_BIT_POSIX_TIMER); 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, static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
unsigned long long *expires, unsigned long long *expires,
unsigned long long cur_time, int signo) unsigned long long cur_time, int signo)
...@@ -903,9 +901,9 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it, ...@@ -903,9 +901,9 @@ static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it,
if (it->incr) { if (it->incr) {
it->expires += it->incr; it->expires += it->incr;
it->error += it->incr_error; it->error += it->incr_error;
if (it->error >= onecputick) { if (it->error >= TICK_NSEC) {
it->expires -= cputime_one_jiffy; it->expires -= cputime_one_jiffy;
it->error -= onecputick; it->error -= TICK_NSEC;
} }
} else { } else {
it->expires = 0; it->expires = 0;
...@@ -1476,15 +1474,10 @@ static __init int init_posix_cpu_timers(void) ...@@ -1476,15 +1474,10 @@ static __init int init_posix_cpu_timers(void)
.clock_get = thread_cpu_clock_get, .clock_get = thread_cpu_clock_get,
.timer_create = thread_cpu_timer_create, .timer_create = thread_cpu_timer_create,
}; };
struct timespec ts;
posix_timers_register_clock(CLOCK_PROCESS_CPUTIME_ID, &process); posix_timers_register_clock(CLOCK_PROCESS_CPUTIME_ID, &process);
posix_timers_register_clock(CLOCK_THREAD_CPUTIME_ID, &thread); 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; return 0;
} }
__initcall(init_posix_cpu_timers); __initcall(init_posix_cpu_timers);
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