From owner-freebsd-current@FreeBSD.ORG Fri Oct 14 21:12:13 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DB4E16A41F for ; Fri, 14 Oct 2005 21:12:13 +0000 (GMT) (envelope-from discussion-lists@linnet.org) Received: from thorn.pobox.com (thorn.pobox.com [208.210.124.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1181B43D48 for ; Fri, 14 Oct 2005 21:12:12 +0000 (GMT) (envelope-from discussion-lists@linnet.org) Received: from thorn (localhost [127.0.0.1]) by thorn.pobox.com (Postfix) with ESMTP id 4856AB7; Fri, 14 Oct 2005 17:10:41 -0400 (EDT) Received: from mappit.local.linnet.org (212-74-113-67.static.dsl.as9105.com [212.74.113.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thorn.sasl.smtp.pobox.com (Postfix) with ESMTP id 7B603617C; Fri, 14 Oct 2005 17:10:37 -0400 (EDT) Received: from lists by mappit.local.linnet.org with local (Exim 4.54 (FreeBSD)) id 1EQWqS-0005UJ-SP; Fri, 14 Oct 2005 22:12:05 +0100 Date: Fri, 14 Oct 2005 22:12:04 +0100 From: Brian Candler To: Eric Anderson Message-ID: <20051014211204.GA21070@uk.tiscali.com> References: <200510131412.23525.max@love2party.net> <20051013181026.GB27418@odin.ac.hmc.edu> <20051014091004.GC18513@uk.tiscali.com> <20051014.085816.104604949.imp@bsdimp.com> <434FDAB2.7040402@centtech.com> <20051014164628.GA20338@uk.tiscali.com> <434FEDA1.4060803@centtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <434FEDA1.4060803@centtech.com> User-Agent: Mutt/1.4.2.1i Cc: max@love2party.net, freebsd-current@freebsd.org, "M. Warner Losh" Subject: Re: ufsstat - testers / feedback wanted! 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: Fri, 14 Oct 2005 21:12:13 -0000 On Fri, Oct 14, 2005 at 12:40:49PM -0500, Eric Anderson wrote: > >Losing the odd count probably isn't a problem, but I think there's the > >possibility of a badly wrong value if you're updating a 64-bit word in two > >halves. For example, it might be possible to wrap around from > >00000000ffffffff to 0000000000000000 instead of 0000000100000000. > > I suppose one could argue that this problem is no worse than using 32bit > integers, except it would be right more often than not. (right?) Well, then it's perhaps better just to have a 32 bit counter in the first place - and the client which reads it _knows_ it has to deal with wraparound itself. If you were graphing rates of filesystem operations via SNMP, for example, that would be fine. Having a 64 bit value is nice if you want to see the total number of operations since you rebooted your machine 3 years ago - but that's arguably more for interest sake than for anything practical. Still, losing 2^32 counts when the above error occurs would make that value even less useful and potentially very misleading. Personally, I think I would err on the side of accurate counters, which can disabled entirely (e.g. via compile-time option or FS mount option), rather than having inaccurate counters. There must be lots of other cases in the kernel of stats counters (e.g. network interface stats) - how do they treat the same problem? Regards, Brian.