From owner-freebsd-amd64@FreeBSD.ORG Wed Mar 21 14:13:10 2007 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A016F16A57E; Wed, 21 Mar 2007 14:13:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from gateway.cybervisiontech.com.ua (gateway.cybervisiontech.com.ua [88.81.251.18]) by mx1.freebsd.org (Postfix) with ESMTP id 5527F13C4EA; Wed, 21 Mar 2007 14:13:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (hq.cybervisiontech.com [127.0.0.1]) by gateway.cybervisiontech.com.ua (Postfix) with ESMTP id 3BC09ED4B85; Wed, 21 Mar 2007 16:13:05 +0200 (EET) X-Virus-Scanned: amavisd-new at cybervisiontech.com Received: from gateway.cybervisiontech.com.ua ([127.0.0.1]) by localhost (hq.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N-u-ibVPhyTT; Wed, 21 Mar 2007 16:12:59 +0200 (EET) Received: from [10.2.1.87] (rein.cybervisiontech.com.ua [10.2.1.87]) by gateway.cybervisiontech.com.ua (Postfix) with ESMTP id BA015ED4B23; Wed, 21 Mar 2007 16:12:59 +0200 (EET) Message-ID: <46013D6F.4020704@icyb.net.ua> Date: Wed, 21 Mar 2007 16:13:03 +0200 From: Andriy Gapon User-Agent: Thunderbird 1.5.0.10 (X11/20070315) MIME-Version: 1.0 To: freebsd-amd64@freebsd.org, freebsd-stable@freebsd.org References: <45FE9B11.5030909@icyb.net.ua> In-Reply-To: <45FE9B11.5030909@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: wollman@FreeBSD.org, tz@elsie.nci.nih.gov Subject: Re: zdump on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2007 14:13:10 -0000 on 19/03/2007 16:15 Andriy Gapon said the following: > Strange problem: > $ uname -srm > FreeBSD 6.2-RELEASE-p2 amd64 > > $ zdump -v EST > EST Sun Jan 26 08:29:52 -219 UTC = Sun Jan 26 03:29:52 -219 EST isdst=0 > gmtoff=-18000 > EST Mon Jan 27 08:29:52 -219 UTC = Mon Jan 27 03:29:52 -219 EST isdst=0 > gmtoff=-18000 > EST Fri Jan 1 04:59:59 -219 UTC = Thu Dec 30 23:59:59 -219 EST isdst=0 > gmtoff=-18000 > EST Fri Jan 1 05:00:00 -219 UTC = Fri Jan 1 00:00:00 -219 EST isdst=0 > gmtoff=-18000 > ^C ... > Before each ^C zdump was hanging eating 100% CPU. > Something about 64-bitness ? Hmm. I hurried to assert that it was hanging, it was actually searching. It seems that zdump -v algorithm is to start with minimal time_t possible (large negative number in our case) and to go to maximum time_t using 12 hours increments and doing certain checks for DST jumps. Well, with 64-bit time_t start date is somewhere 200 milliard (10^9) years ago and end date is the same in the future, so iteration over those years takes quite a while. And tz db doesn't contain anything useful for too distant years anyway. I think that zdump should be optimized to limit its search range. At the very least for the start point - what is current estimate of the age of our Universe :-) -- Andriy Gapon