From: Patrick K. <pet...@gm...> - 2003-09-04 16:28:28
|
Hi, I found a bug in the 2.6.0-test? kernels. /proc/uptime shows a uptime=20 since the start of the epoch, approx. 33 years. Is anybody able to reproduce this bug? mfg, Patrick "Petschge" Kilian -- =20 I still think the fastest way to get wholesale IPv6 adoption is to write a pr0n server that serves thumbnails over IPv[46] and full-size images over IPv6 only. -- Ingvar |
From: Geert U. <ge...@li...> - 2003-09-04 19:12:58
|
On Thu, 4 Sep 2003, Patrick Kilian wrote: > I found a bug in the 2.6.0-test? kernels. /proc/uptime shows a uptime > since the start of the epoch, approx. 33 years. > Is anybody able to reproduce this bug? | virtual:~# uptime | Unknown HZ value! (0) Assume 100. | 21:10:46 up 12299 days, 19:10, 1 user, load average: 0.84, 0.62, 0.27 | virtual:~# cat /proc/uptime | 1062702653.67 31.10 | virtual:~# uname -a | Linux virtual 2.6.0-test3-1um #7 Tue Sep 2 17:07:34 CEST 2003 i686 unknown | virtual:~# Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |
From: Patrick \Petschge\ K. <pet...@we...> - 2003-09-05 15:20:53
|
Hi, I looks like the bug was introduced in 2.5.60. Till then fs/pro/proc_misc.c looked like: unsigned long uptime; unsigned long idle; uptime = jiffies; idle = init_task.utime + init_task.stime; This producced the famous error after +400 days of uptime. Now it looks like this: struct timespec uptime; struct timespec idle; int len; u64 idle_jiffies = init_task.utime + init_task.stime; do_posix_clock_monotonic_gettime(&uptime); jiffies_to_timespec(idle_jiffies, &idle); And do_posix_clock_monotonic_gettime gives us a wrong value for uptime. The call path is something like this: uptime_read_proc (fs/proc_misc.c) do_posix_clock_monotonic_gettime (kernel/posix-timers.c) do_posix_clock_monotonic_gettime_parts (kernel/posix-timers.c) do_gettimeofday (arch/um/kernel/time.c) gettimeofday (hostkernel) This call path is pretty much the same for non-um archs. Only the way do_gettimeofday works is different. So eather the do_gettimeofday in arch/um is broken or this bug exists on all arch. Could someone please test if 2.6.0-test? gets the uptime on real hardware right? mfg, Patrick "Petschge" Kilian -- rfc1149 mit Marschflugkörpern?Leider nur bedingt Rückkanal-fähig... -- Nicholas Preyß in d.o.c |
From: Patrick \Petschge\ K. <pet...@we...> - 2003-09-06 19:12:16
|
Hi, I have a patch which gives the correct uptime. I don't know what the patch breaks so please post any problems you have. ----- --- ./linux-2.6.0-test3/fs/proc/proc_misc.c Sat Sep 6 12:34:37 2003 +++ ./linux-2.6.0-test3-uml/fs/proc/proc_misc.c Sat Sep 6 21:02:20 2003 @@ -142,7 +142,7 @@ int len; u64 idle_jiffies = init_task.utime + init_task.stime; - do_posix_clock_monotonic_gettime(&uptime); + jiffies_to_timespec(get_jiffies_64(), &uptime); jiffies_to_timespec(idle_jiffies, &idle); len = sprintf(page,"%lu.%02lu %lu.%02lu\n", (unsigned long) uptime.tv_sec, ----- mfg, Patrick "Petschge" Kilian -- Morgens wollte sie ihn spüren, mit den Lippen zart berühren, ...und zum blasen heranzuführen, heiss floss es in sie hinein. Ja so ein Kaffe. Der ist fein |
From: Jeff D. <jd...@ad...> - 2003-09-09 16:16:19
|
pet...@we... said: > I have a patch which gives the correct uptime. I don't know what the > patch breaks so please post any problems you have. Have you been able to figure out whether this is also a problem for other ports? Your patch suggests that it is, and if it is, then you should send it to LKML so it can be fixed in mainline. Jeff |
From: Patrick \Petschge\ K. <pet...@we...> - 2003-09-10 12:29:29
|
Hi, >> I have a patch which gives the correct uptime. I don't know what the >> patch breaks so please post any problems you have. > Have you been able to figure out whether this is also a problem for other > ports? Your patch suggests that it is, and if it is, then you should send > it to LKML so it can be fixed in mainline. I don't know if other arch beside uml give the wrong uptime. If anyone could check this on i386 or other "read" hardware I'd be glad to hear the result. Looking at the code and the callpath all arch should have this bug. If someone is able to confirm this I'm going to post the patch to the lkml. mfg, Patrick "Petschge" Kilian -- Spam ist weniger ein technisches als ein soziales Problem. Die einzigen technischen Mittel, die soziale Probleme halbwegs brauchbar loesen, sind schwere Waffen. Und das auch nur bei wirklich konsequenter Anwendung. -- Alexander Schreiber in dasr |