From owner-freebsd-current@FreeBSD.ORG Thu Dec 21 11:15:38 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEC0616A568 for ; Thu, 21 Dec 2006 11:15:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5950E13C428 for ; Thu, 21 Dec 2006 11:15:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id kBL1tEpi078778; Wed, 20 Dec 2006 18:55:15 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 20 Dec 2006 18:55:14 -0700 (MST) Message-Id: <20061220.185514.-345500127.imp@bsdimp.com> To: youshi10@u.washington.edu From: "M. Warner Losh" In-Reply-To: <45889598.3030408@u.washington.edu> References: <45887A31.4050801@paradise.net.nz> <790a9fff0612191741r656fbbe0ic8660a9c59ba632b@mail.gmail.com> <45889598.3030408@u.washington.edu> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 20 Dec 2006 18:55:15 -0700 (MST) Cc: freebsd-current@freebsd.org Subject: Re: settimeofday function taking 24 - 30 minutes to complete X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2006 11:15:39 -0000 In message: <45889598.3030408@u.washington.edu> Garrett Cooper writes: : Scot Hetzel wrote: : > On 12/19/06, Mark Kirkwood wrote: : >> Mark Kirkwood wrote: : >> : >> > Just tried out this on 6-STABLE : >> : >> > I can't get the hang at all (with or without thee extra includes): : >> > : >> > # time ./settimetest : >> > INFO: Saved current time : >> > INFO: settimeofday completed sucessfully : >> > INFO: Reset time to original value : >> > 0.000u 0.002s 0:00.00 0.0% 0+0k 0+0io 0pf+0w : >> > : >> : >> Oops - thought I was reading -stable instead of -current list : >> (doh).. sorry! Well at least you know it can work on *some* version of : >> FreeBSD!....(I don't have any machines running -current at the moment to : >> test). : >> : > : > Here's the time for the test on FreeBSD/amd64 -CURRENT, update yesterday. : > : > hp010# date ; time ./t1 ; date : > Tue Dec 19 19:07:33 CST 2006 : > INFO: Saved current time : > INFO: settimeofday completed sucessfully : > INFO: Reset time to original value : > 0.000u 1469.241s 0:00.00 0.0% 5+175k 0+0io 0pf+0w : > Tue Dec 19 19:07:33 CST 2006 : > hp010# date 200612191933 : > Tue Dec 19 19:33:00 CST 2006 : > : > Scot : Well, I'll find a random unused machine, setup FreeBSD on it with vmware : and then try that out. Seems interesting that it takes 30 minutes to run : instead of being done almost instantaneously. It does run almost instantly if you use a time from 2000. The date command also causes the lockup if you say 'date 1970010100140' as well. Looks like there's a loop in the kernel to do division, but I can't quite find where it is. If you have a good test setup, maybe you can do a binary search in the settimeofday code to find why a large leap backwards causes problems. Warner