[lkml]   [2004]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: boot time, process start time, and NOW time
Tim Schmielau wrote:
> On Mon, 16 Aug 2004, Andrew Morton wrote:
>>OGAWA Hirofumi <> wrote:
>>>Albert Cahalan <> writes:
>>>>Even with the 2.6.7 kernel, I'm still getting reports of process
>>>>start times wandering. Here is an example:
>>>> "About 12 hours since reboot to 2.6.7 there was already a
>>>> difference of about 7 seconds between the real start time
>>>> and the start time reported by ps. Now, 24 hours since reboot
>>>> the difference is 10 seconds."
>>>>The calculation used is:
>>>> now - uptime + time_from_boot_to_process_start
>>>Start-time and uptime is using different source. Looks like the
>>>jiffies was added bogus lost counts.
>>>quick hack. Does this change the behavior?
>>Where did this all end up? Complaints about wandering start times are
>>persistent, and it'd be nice to get some fix in place...
> The trouble seems to be due to the patch below, part of a larger cleanup
> (|src/.|src/fs|src/fs/proc|related/fs/proc/proc_misc.c)
> by George.
> Quoting from the changelog entry:
> "Changes the uptime code to use the posix_clock_monotonic notion of
> uptime instead of the jiffies. This time will track NTP changes and so should
> be better than your standard wristwatch (if your using ntp)."
> George is absolutely right that it's more precise. However, it's also
> inconsistent with the process start times which use plain uncorrected
> jiffies. ps stumbles over this inconsistency.
> Simple fix: revert the patch below.
> Complicated fix: correct process start times in fork.c (no patch provided,
> too complicated for me to do).
> George?

Hm... That patch was for a reason... It seems to me that doing anything short
of putting "xtime" (or better, clock_gettime() :)) in at fork time is not going
to fix anything. As written the start_time in the task_struct is fixed. If
"now - uptime + time_from_boot_to_process_start" it is wandering, it must be the
fault of "now - uptime". Since this seems to be wandering, and we corrected
uptime in the referenced patch, is it safe to assume that "now" is actually
being computed from "jiffies" rather than a gettimeofday()?

Seems like that is where we should be changing things.

George Anzinger
Preemption patch:

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:05    [W:0.167 / U:12.992 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site