From owner-svn-src-head@FreeBSD.ORG Sun Jul 11 09:27:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2563106564A; Sun, 11 Jul 2010 09:27:06 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1FA8FC12; Sun, 11 Jul 2010 09:27:06 +0000 (UTC) Received: from [192.168.2.105] (host86-162-156-210.range86-162.btcentralplus.com [86.162.156.210]) by cyrus.watson.org (Postfix) with ESMTPSA id BE7C846B06; Sun, 11 Jul 2010 05:27:05 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Sun, 11 Jul 2010 10:27:03 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <001126CD-F68F-46A3-90CE-CA2BE6E36B8E@freebsd.org> References: <4C376B0E.9050505@FreeBSD.org> <4C37713D.5060202@FreeBSD.org> <4A28A601-C87F-47C6-8CBE-5F1BF866CA4A@FreeBSD.org> To: Gabor PALI X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jul 2010 09:27:06 -0000 On 11 Jul 2010, at 04:18, Gabor PALI wrote: > On Sat, Jul 10, 2010 at 5:24 PM, Robert N. M. Watson > wrote: >> If we can do it in one atomic in the common case, and two atomics in = an edge case, that sounds fine. I think any use of locking(9) would be = sufficiently costly as to not be worth the improvements in consistency, = given the frequency of statistics operations. >=20 > I have tried to use atomic operations for counting (without > locking(9)), but they turned out to be significantly slower than the > naive case indeed. If consistency is not so important for statistics, > whether would it be safe to simply use 64-bit variables for counters > everywhere on all architectures? I think the worry comes down to: an occasional missed packet is OK, but = a duplicated carry(for example) from the lower 32 bits to the upper 32 = bits would put the counter off by 4 billion, which is not really = acceptable. What sort of measurement did you do to show the speed loss, BTW? Robert