diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 22:28:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 22:28:09 -0500 |
commit | fbf07eac7bf21c262143194181bd97c5d18b8ceb (patch) | |
tree | c9228b7d272f1e39472da28032605ecd1860e688 /kernel | |
parent | 60d8ce2cd6c283132928c11f3fd57ff4187287e0 (diff) | |
parent | 8629ea2eaba8ca0de2e38ce1b4a825e16255976e (diff) |
Merge branch 'timers-for-linus-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
hrtimer: Fix /proc/timer_list regression
itimers: Fix racy writes to cpu_itimer fields
timekeeping: Fix clock_gettime vsyscall time warp
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/itimer.c | 7 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/kernel/itimer.c b/kernel/itimer.c index b03451ede528..d802883153da 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c | |||
@@ -146,6 +146,7 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id, | |||
146 | { | 146 | { |
147 | cputime_t cval, nval, cinterval, ninterval; | 147 | cputime_t cval, nval, cinterval, ninterval; |
148 | s64 ns_ninterval, ns_nval; | 148 | s64 ns_ninterval, ns_nval; |
149 | u32 error, incr_error; | ||
149 | struct cpu_itimer *it = &tsk->signal->it[clock_id]; | 150 | struct cpu_itimer *it = &tsk->signal->it[clock_id]; |
150 | 151 | ||
151 | nval = timeval_to_cputime(&value->it_value); | 152 | nval = timeval_to_cputime(&value->it_value); |
@@ -153,8 +154,8 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id, | |||
153 | ninterval = timeval_to_cputime(&value->it_interval); | 154 | ninterval = timeval_to_cputime(&value->it_interval); |
154 | ns_ninterval = timeval_to_ns(&value->it_interval); | 155 | ns_ninterval = timeval_to_ns(&value->it_interval); |
155 | 156 | ||
156 | it->incr_error = cputime_sub_ns(ninterval, ns_ninterval); | 157 | error = cputime_sub_ns(nval, ns_nval); |
157 | it->error = cputime_sub_ns(nval, ns_nval); | 158 | incr_error = cputime_sub_ns(ninterval, ns_ninterval); |
158 | 159 | ||
159 | spin_lock_irq(&tsk->sighand->siglock); | 160 | spin_lock_irq(&tsk->sighand->siglock); |
160 | 161 | ||
@@ -168,6 +169,8 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id, | |||
168 | } | 169 | } |
169 | it->expires = nval; | 170 | it->expires = nval; |
170 | it->incr = ninterval; | 171 | it->incr = ninterval; |
172 | it->error = error; | ||
173 | it->incr_error = incr_error; | ||
171 | trace_itimer_state(clock_id == CPUCLOCK_VIRT ? | 174 | trace_itimer_state(clock_id == CPUCLOCK_VIRT ? |
172 | ITIMER_VIRTUAL : ITIMER_PROF, value, nval); | 175 | ITIMER_VIRTUAL : ITIMER_PROF, value, nval); |
173 | 176 | ||
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index d1aebd73b191..af4135f05825 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -170,7 +170,7 @@ void timekeeping_leap_insert(int leapsecond) | |||
170 | { | 170 | { |
171 | xtime.tv_sec += leapsecond; | 171 | xtime.tv_sec += leapsecond; |
172 | wall_to_monotonic.tv_sec -= leapsecond; | 172 | wall_to_monotonic.tv_sec -= leapsecond; |
173 | update_vsyscall(&xtime, timekeeper.clock); | 173 | update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); |
174 | } | 174 | } |
175 | 175 | ||
176 | #ifdef CONFIG_GENERIC_TIME | 176 | #ifdef CONFIG_GENERIC_TIME |
@@ -328,7 +328,7 @@ int do_settimeofday(struct timespec *tv) | |||
328 | timekeeper.ntp_error = 0; | 328 | timekeeper.ntp_error = 0; |
329 | ntp_clear(); | 329 | ntp_clear(); |
330 | 330 | ||
331 | update_vsyscall(&xtime, timekeeper.clock); | 331 | update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); |
332 | 332 | ||
333 | write_sequnlock_irqrestore(&xtime_lock, flags); | 333 | write_sequnlock_irqrestore(&xtime_lock, flags); |
334 | 334 | ||
@@ -840,7 +840,7 @@ void update_wall_time(void) | |||
840 | timekeeper.ntp_error_shift; | 840 | timekeeper.ntp_error_shift; |
841 | 841 | ||
842 | /* check to see if there is a new clocksource to use */ | 842 | /* check to see if there is a new clocksource to use */ |
843 | update_vsyscall(&xtime, timekeeper.clock); | 843 | update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); |
844 | } | 844 | } |
845 | 845 | ||
846 | /** | 846 | /** |