From owner-freebsd-stable@FreeBSD.ORG Wed May 21 02:18:51 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DE1837B401 for ; Wed, 21 May 2003 02:18:51 -0700 (PDT) Received: from prg.traveller.cz (prg.traveller.cz [193.85.2.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C49543F85 for ; Wed, 21 May 2003 02:18:50 -0700 (PDT) (envelope-from mime@traveller.cz) Received: from prg.traveller.cz (localhost [127.0.0.1])h4L9Im1O084150 for ; Wed, 21 May 2003 11:18:48 +0200 (CEST) Received: from localhost (mime@localhost)id h4L9Im7c084147 for ; Wed, 21 May 2003 11:18:48 +0200 (CEST) Date: Wed, 21 May 2003 11:18:48 +0200 (CEST) From: Michal Mertl To: freebsd-stable@freebsd.org Message-ID: <20030521104442.G65751@prg.traveller.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: 4GB limit with netstat X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2003 09:18:51 -0000 I also didn't like the limitation and we had long discussions about 64 bit counters in Jan 2002. The problem is that there isn't really cheap way to do safe (atomic) updates of 64 bit numbers on SMP x86. The conclusion at time was mostly that counting in 64 bit on 32 bit arch was too expensive. I have a patch which increases the width and adds small api for safe updating of wide counters (for 4.5 or something). Other solution is to keep the type of kernel-updated counters and if needed (on 32 bit archs) have some aggregation counters which would be once in a while (e.g. 10 times a second) updated with some kernel thread. I also have proof-of-concept patch with this approach. As SMPng locking of network stack and drivers is taking place it seems some counters could be made u_int64 rather cheaply - the structures containing the counters should be locked for update anyway so the update can be achieved then by simple means even on 32bit arch. -- Michal Mertl mime@traveller.cz