Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 03:20:05 -0800 (PST)
From:      "Tim Robbins" <tim@robbins.dropbear.id.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   kern/50045: Kernel threads and init have incorrect start time
Message-ID:  <200303161120.h2GBK58d037774@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/50045; it has been noted by GNATS.

From: "Tim Robbins" <tim@robbins.dropbear.id.au>
To: <FreeBSD-gnats-submit@FreeBSD.org>
Cc:  
Subject: kern/50045: Kernel threads and init have incorrect start time
Date: Sun, 16 Mar 2003 22:07:07 +1100 (EST)

 >Number:         50045
 >Category:       kern
 >Synopsis:       Kernel threads and init have incorrect start time
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       medium
 >Responsible:    freebsd-bugs
 >State:          open
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          sw-bug
 >Submitter-Id:   current-users
 >Arrival-Date:   Sun Mar 16 03:10:06 PST 2003
 >Closed-Date:
 >Last-Modified:
 >Originator:     Tim Robbins
 >Release:        FreeBSD 5.0-RELEASE
 >Organization:
 The FreeBSD Project
 >Environment:
 System: FreeBSD 5.0-RELEASE
 
 =09
 >Description:
 The start time, as shown by ps -aux, is incorrect for kernel threads and
 init. The times are shown as January 1, 1970, instead of the system boot
 time.
 >How-To-Repeat:
 ps -aux
 >Fix:
 
 The problem seems to occur because inittodr() is not called early
 enough. I think revision 1.888 of init_main.c is the culprit:
 
 revision 1.188
 date: 2002/03/08 10:33:11;  author: phk;  state: Exp;  lines: +2 -0
 Move the mount of the root filesystem to happen in the init process before
 the exec if /sbin/init.
 
 This allows the scheduler to get started and kthreads a chance to run
 before we start filesystem operations.
 
 This patch makes the start times for kernel threads + init as correct as
 they are on RELENG_4 by calling inittodr() from inittimecounter().
 It has only been tested on i386.
 
 Index: kern_tc.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /x/freebsd/src/sys/kern/kern_tc.c,v
 retrieving revision 1.145
 diff -u -r1.145 kern_tc.c
 --- kern_tc.c=0916 Jan 2003 20:06:45 -0000=091.145
 +++ kern_tc.c=0917 Jan 2003 11:45:07 -0000
 @@ -692,6 +692,9 @@
  =09/* warm up new timecounter (again) and get rolling. */
  =09(void)timecounter->tc_get_timecount(timecounter);
  =09(void)timecounter->tc_get_timecount(timecounter);
 +
 +=09/* Initialise the time of day register. */
 +=09inittodr(0);
  }
  
  SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL=
 )
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303161120.h2GBK58d037774>