From owner-freebsd-bugs Sun Mar 16 3:10: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 99A3537B401 for ; Sun, 16 Mar 2003 03:10:08 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F5F943FA3 for ; Sun, 16 Mar 2003 03:10:07 -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 h2GBA7NS035517 for ; Sun, 16 Mar 2003 03:10:07 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2GBA7ET035516; Sun, 16 Mar 2003 03:10:07 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D28B37B401 for ; Sun, 16 Mar 2003 03:07:22 -0800 (PST) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EEB243FB1 for ; Sun, 16 Mar 2003 03:07:21 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au ([210.50.221.219]) by smtp01.syd.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Sun, 16 Mar 2003 22:07:15 +1100 Received: from dilbert.robbins.dropbear.id.au (260g6rid71x8xsf8@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h2GB77JK084190 for ; Sun, 16 Mar 2003 22:07:09 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h2GB7712084189; Sun, 16 Mar 2003 22:07:07 +1100 (EST) (envelope-from tim) Message-Id: <200303161107.h2GB7712084189@dilbert.robbins.dropbear.id.au> Date: Sun, 16 Mar 2003 22:07:07 +1100 (EST) From: Tim Robbins Reply-To: Tim Robbins To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/50045: Kernel threads and init have incorrect start time 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 >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 >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 =================================================================== 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 16 Jan 2003 20:06:45 -0000 1.145 +++ kern_tc.c 17 Jan 2003 11:45:07 -0000 @@ -692,6 +692,9 @@ /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); + + /* Initialise the time of day register. */ + inittodr(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