Commit 16118794 authored by Thomas Gleixner's avatar Thomas Gleixner

posix-cpu-timers: Remove private interval storage

Posix CPU timers store the interval in private storage for historical
reasons (it_interval used to be a non scalar representation on 32bit
systems). This is gone and there is no reason for duplicated storage
anymore.

Use it_interval everywhere.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Link: https://lkml.kernel.org/r/20190111133500.945255655@linutronix.de
parent b17d1ce7
...@@ -12,7 +12,7 @@ struct siginfo; ...@@ -12,7 +12,7 @@ struct siginfo;
struct cpu_timer_list { struct cpu_timer_list {
struct list_head entry; struct list_head entry;
u64 expires, incr; u64 expires;
struct task_struct *task; struct task_struct *task;
int firing; int firing;
}; };
......
...@@ -67,13 +67,13 @@ static void bump_cpu_timer(struct k_itimer *timer, u64 now) ...@@ -67,13 +67,13 @@ static void bump_cpu_timer(struct k_itimer *timer, u64 now)
int i; int i;
u64 delta, incr; u64 delta, incr;
if (timer->it.cpu.incr == 0) if (!timer->it_interval)
return; return;
if (now < timer->it.cpu.expires) if (now < timer->it.cpu.expires)
return; return;
incr = timer->it.cpu.incr; incr = timer->it_interval;
delta = now + incr - timer->it.cpu.expires; delta = now + incr - timer->it.cpu.expires;
/* Don't use (incr*2 < delta), incr*2 might overflow. */ /* Don't use (incr*2 < delta), incr*2 might overflow. */
...@@ -520,7 +520,7 @@ static void cpu_timer_fire(struct k_itimer *timer) ...@@ -520,7 +520,7 @@ static void cpu_timer_fire(struct k_itimer *timer)
*/ */
wake_up_process(timer->it_process); wake_up_process(timer->it_process);
timer->it.cpu.expires = 0; timer->it.cpu.expires = 0;
} else if (timer->it.cpu.incr == 0) { } else if (!timer->it_interval) {
/* /*
* One-shot timer. Clear it as soon as it's fired. * One-shot timer. Clear it as soon as it's fired.
*/ */
...@@ -606,7 +606,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, ...@@ -606,7 +606,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
*/ */
ret = 0; ret = 0;
old_incr = timer->it.cpu.incr; old_incr = timer->it_interval;
old_expires = timer->it.cpu.expires; old_expires = timer->it.cpu.expires;
if (unlikely(timer->it.cpu.firing)) { if (unlikely(timer->it.cpu.firing)) {
timer->it.cpu.firing = -1; timer->it.cpu.firing = -1;
...@@ -684,8 +684,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, ...@@ -684,8 +684,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
* Install the new reload setting, and * Install the new reload setting, and
* set up the signal and overrun bookkeeping. * set up the signal and overrun bookkeeping.
*/ */
timer->it.cpu.incr = timespec64_to_ns(&new->it_interval); timer->it_interval = timespec64_to_ktime(new->it_interval);
timer->it_interval = ns_to_ktime(timer->it.cpu.incr);
/* /*
* This acts as a modification timestamp for the timer, * This acts as a modification timestamp for the timer,
...@@ -724,7 +723,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp ...@@ -724,7 +723,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp
/* /*
* Easy part: convert the reload time. * Easy part: convert the reload time.
*/ */
itp->it_interval = ns_to_timespec64(timer->it.cpu.incr); itp->it_interval = ktime_to_timespec64(timer->it_interval);
if (!timer->it.cpu.expires) if (!timer->it.cpu.expires)
return; return;
......
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