From owner-freebsd-fs@FreeBSD.ORG Mon Jan 31 09:03:56 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 585E71065694; Mon, 31 Jan 2011 09:03:56 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AA9618FC34; Mon, 31 Jan 2011 09:03:55 +0000 (UTC) Received: by bwz12 with SMTP id 12so5109898bwz.13 for ; Mon, 31 Jan 2011 01:03:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=734LAX8Pat4A+J/xMUIlI6+tmeaAwfFoI0yKMOsn+ik=; b=sZjJ15elfaCkEmpFRvMHZ7Dr0GYczgKQ2SzJpuOA9bRcjVWbOZijQGlhWphffpi9dV HBue71xeo4/kz3eU6rgQyqBpamn8XQWwYG041mm0DQazsNezVg9jR2wUn+qT7SmJ3x3R 2Xu/HzoTl8W49eSbNo5xlUQPtvOpnxJQqQM1k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=cNHggIETVTdBVrbu1SP2Ds0RaSnM57Ijt6Nyu4I5bdDEIxIv5CBHGBxwplSu7jIIHO KQNwDcFODW/dRr5NhFw+QTFegWB3PE3fPFBbIJwHDpxc0Wzs6cQrkenaGpQrOrw5hsRd QC/1chM6C5jvdDksmRonTrXZ45UK/bVJ1M81M= MIME-Version: 1.0 Received: by 10.204.123.14 with SMTP id n14mr4967377bkr.49.1296464632910; Mon, 31 Jan 2011 01:03:52 -0800 (PST) Sender: artemb@gmail.com Received: by 10.204.49.13 with HTTP; Mon, 31 Jan 2011 01:03:52 -0800 (PST) In-Reply-To: <20110131160644.P2539@besplex.bde.org> References: <4D443407.7010604@FreeBSD.org> <4D45F359.4040402@FreeBSD.org> <20110131160644.P2539@besplex.bde.org> Date: Mon, 31 Jan 2011 01:03:52 -0800 X-Google-Sender-Auth: KO7g3HCfKKa6DX_wzwYf36-O3Dg Message-ID: From: Artem Belevich To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs Subject: Re: ZFS: clock_t overflow in l2arc_feed_thread X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 09:03:56 -0000 On Sun, Jan 30, 2011 at 9:25 PM, Bruce Evans wrote: > On Mon, 31 Jan 2011, Martin Matuska wrote: > >> I have re-checked OpenSolaris, and discovered that long is a int32_t. Not true. It's 'long' which would be int64_t on LP64 and int32_t on ILP32 http://src.opensolaris.org/source/search?q=3D&project=3Donnv&defs=3Dclock_t= &refs=3D&path=3D&hist=3D > Why be different from both OpenSolaris and FreeBSD? =A0clock_t is 32 bits > on all, and only bogusly signed on some. See above. > Also, there must be another bug for overflow to occur after only 24 days. > clock_t is only specified for holding statclock ticks, which have a > frequency of about 128 Hz, so 32-bit unsigned ints hold 388 days of ticks= . clock_t is used in solaris code to hold LBOLT (rough equivalent of *uptime() in FreeBSD). When the code was ported to FreeBSD, LBOLT was implemented so that it holds uptime in HZ ticks. HZ happens to be 1000, so clock_t as implemented on FreeBSD will overflow in 24 days. --Artem