From owner-svn-src-head@FreeBSD.ORG Sat Jul 10 15:24:46 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 EB4FB106564A; Sat, 10 Jul 2010 15:24:46 +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 C5FD68FC12; Sat, 10 Jul 2010 15:24:46 +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 EE03246BA7; Sat, 10 Jul 2010 11:24:45 -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: <4C37713D.5060202@FreeBSD.org> Date: Sat, 10 Jul 2010 16:24:43 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4A28A601-C87F-47C6-8CBE-5F1BF866CA4A@FreeBSD.org> References: <4C376B0E.9050505@FreeBSD.org> <4C37713D.5060202@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: Sat, 10 Jul 2010 15:24:47 -0000 On 9 Jul 2010, at 19:58, Gabor PALI wrote: >> I assume there are reasonable alternatives that work around the >> potential race with a small probability of a missed or extra update, >> or similar, which would be fine. >=20 > In a few words: As far as I know, 64-bit atomic counters could be > implemented by using cmpxchg8b or by a plain uint64_t variable = protected > by some kind of locking(9). 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. Robert=