From owner-freebsd-arch Fri Oct 26 14:24:21 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id AE3BE37B406 for ; Fri, 26 Oct 2001 14:24:10 -0700 (PDT) Received: (qmail 39084 invoked from network); 26 Oct 2001 21:24:09 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 26 Oct 2001 21:24:09 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200110262113.f9QLDBJ38657@apollo.backplane.com> Date: Fri, 26 Oct 2001 14:24:07 -0700 (PDT) From: John Baldwin To: Matthew Dillon Subject: Re: 64 bit times revisited.. Cc: Bakul Shah , Peter Wemm , arch@FreeBSD.ORG, Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 26-Oct-01 Matthew Dillon wrote: > >: >: >::> >::> If you look in sys/kern/kern_tc.c you can see how much extra >::> gunk that results in, checking for overruns on the middle part and >::> whats not. >::> >::> There can be no doubt that the best timestamp representation is >::> pure binary, originating at the second, and that is how my proposal >::> is constructed: >::> >::> <-- 32bit --><-- 32bit --> . <-- 32bit --><-- 32bit --> >::> 1 2 3 4 >:: >::IOW, a fixed-point number. This is definitely the optimal solution >::presented >::so far for the in-kernel time keeping, IMO. > > And I will also note that trying to represent both seconds and sub-seconds > in a single fixed point integer is a real bad idea. It makes life > unnecessarily difficult for the 95% of the code that only needs the > seconds portion. Any fractional representation should be a SEPARATE > field. Err it is a separate field. You have a 128-bit counter. The high 64-bits are the seconds portion. You just shift to get the seconds. This is not hard. Computers have been good at doing shift right's for quite some time now. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message