Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jul 2010 10:27:03 +0100
From:      "Robert N. M. Watson" <rwatson@freebsd.org>
To:        Gabor PALI <pgj@FreeBSD.org>
Cc:        svn-src-head@freebsd.org
Subject:   Re: svn commit: r209119 - head/sys/sys
Message-ID:  <001126CD-F68F-46A3-90CE-CA2BE6E36B8E@freebsd.org>
In-Reply-To: <AANLkTikkDxOPhiA_NYmwO_Bpxb9g2M7UGRpBW85dBN_I@mail.gmail.com>
References:  <4C376B0E.9050505@FreeBSD.org> <alpine.BSF.2.00.1007091949170.94277@fledge.watson.org> <4C37713D.5060202@FreeBSD.org> <4A28A601-C87F-47C6-8CBE-5F1BF866CA4A@FreeBSD.org> <AANLkTikkDxOPhiA_NYmwO_Bpxb9g2M7UGRpBW85dBN_I@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 11 Jul 2010, at 04:18, Gabor PALI wrote:

> On Sat, Jul 10, 2010 at 5:24 PM, Robert N. M. Watson
> <rwatson@freebsd.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001126CD-F68F-46A3-90CE-CA2BE6E36B8E>