From owner-freebsd-bugs Sun Mar 16 3:20:12 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A32437B422 for ; Sun, 16 Mar 2003 03:20:06 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 827F243F3F for ; Sun, 16 Mar 2003 03:20:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2GBK5NS037775 for ; Sun, 16 Mar 2003 03:20:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2GBK58d037774; Sun, 16 Mar 2003 03:20:05 -0800 (PST) Date: Sun, 16 Mar 2003 03:20:05 -0800 (PST) Message-Id: <200303161120.h2GBK58d037774@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Tim Robbins" Subject: kern/50045: Kernel threads and init have incorrect start time Reply-To: "Tim Robbins" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/50045; it has been noted by GNATS. From: "Tim Robbins" To: 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