* 2.6.8.1: xtime value may become incorrect
@ 2004-09-27 15:22 Vladimir Grouzdev
2004-09-27 15:52 ` john stultz
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Grouzdev @ 2004-09-27 15:22 UTC (permalink / raw)
To: linux-kernel; +Cc: johnstul
The xtime value may become incorrect when the
update_wall_time(ticks) function is called with "ticks" > 1.
In such a case, the xtime variable is updated multiple times
inside the loop but it is normalized only once outside of
the loop.
This bug was reported at:
http://bugme.osdl.org/show_bug.cgi?id=3403
Patch to fix the problem:
diff -Nrca linux-2.6.8.1/kernel/timer.c linux-2.6.8.1-patched/kernel/timer.c
*** linux-2.6.8.1/kernel/timer.c 2004-08-14 12:56:00.000000000 +0200
--- linux-2.6.8.1-patched/kernel/timer.c 2004-09-27
16:24:48.000000000 +0200
***************
*** 776,788 ****
do {
ticks--;
update_wall_time_one_tick();
} while (ticks);
-
- if (xtime.tv_nsec >= 1000000000) {
- xtime.tv_nsec -= 1000000000;
- xtime.tv_sec++;
- second_overflow();
- }
}
static inline void do_process_times(struct task_struct *p,
--- 776,787 ----
do {
ticks--;
update_wall_time_one_tick();
+ if (xtime.tv_nsec >= 1000000000) {
+ xtime.tv_nsec -= 1000000000;
+ xtime.tv_sec++;
+ second_overflow();
+ }
} while (ticks);
}
static inline void do_process_times(struct task_struct *p,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 2.6.8.1: xtime value may become incorrect
2004-09-27 15:22 2.6.8.1: xtime value may become incorrect Vladimir Grouzdev
@ 2004-09-27 15:52 ` john stultz
0 siblings, 0 replies; 2+ messages in thread
From: john stultz @ 2004-09-27 15:52 UTC (permalink / raw)
To: Vladimir Grouzdev; +Cc: lkml
On Mon, 2004-09-27 at 08:22, Vladimir Grouzdev wrote:
> The xtime value may become incorrect when the
> update_wall_time(ticks) function is called with "ticks" > 1.
> In such a case, the xtime variable is updated multiple times
> inside the loop but it is normalized only once outside of
> the loop.
Vladimir,
This looks like a good patch to me. If no one else has any complaints,
send it on to Andrew.
thanks!
-john
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-27 15:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-27 15:22 2.6.8.1: xtime value may become incorrect Vladimir Grouzdev
2004-09-27 15:52 ` john stultz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.