From owner-freebsd-current@FreeBSD.ORG Wed Jul 19 13:16:02 2006 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 90A0216A4DA for ; Wed, 19 Jul 2006 13:16:02 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id B59BA43D49 for ; Wed, 19 Jul 2006 13:16:01 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (jylqnu@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k6JDFpem048355 for ; Wed, 19 Jul 2006 15:16:00 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k6JDFpvM048354; Wed, 19 Jul 2006 15:15:51 +0200 (CEST) (envelope-from olli) Date: Wed, 19 Jul 2006 15:15:51 +0200 (CEST) Message-Id: <200607191315.k6JDFpvM048354@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG In-Reply-To: <1153312635.1261.22.camel@genius.i.cz> X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 19 Jul 2006 15:16:00 +0200 (CEST) X-Mailman-Approved-At: Wed, 19 Jul 2006 13:48:36 +0000 Cc: Subject: Re: vmstat's entries type X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2006 13:16:02 -0000 Michal Mertl wrote: > We had discussions about 64 bit counters several times during the years > (I made a huge patch which turned every network related counter 64bit > and all accesses were made with a macro) and the conclusion was that it > isn't worth it. > > 64bit numbers are too expensive to do correctly on 32bit machines. When > done incorrectly they can easily get incorrect and that is probably > worse than a simple counter in machine's native word size (which can > still get incorrect on some architectures). > > I expect you know that long is usually 64bit wide on 64bit > architectures. The discussion about 64bit counters on 32bit machines > doesn't make much sense when AMD64 is becoming the mainstream > architecture and the right type to use for integers (that can get > "large") is long IMHO. I see. I'm mostly a userland programmer, and when there's a variable that might overflow 32 bits, then I always use a 64 bit type (e.g. uint64_t), no matter whether I'm on a 32 bit or 64 bit architecture. It's all about portability and reliability. In fact, I rarely use "long", because I think it's not very useful. However, I got your point. Kernel programming is different from userland programming, and I'm aware that using 64 bit values can cause problems on 32 bit architectures (which I mentioned in my previous mail). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. With Perl you can manipulate text, interact with programs, talk over networks, drive Web pages, perform arbitrary precision arithmetic, and write programs that look like Snoopy swearing.