Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jul 2010 16:24:43 +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:  <4A28A601-C87F-47C6-8CBE-5F1BF866CA4A@FreeBSD.org>
In-Reply-To: <4C37713D.5060202@FreeBSD.org>
References:  <4C376B0E.9050505@FreeBSD.org> <alpine.BSF.2.00.1007091949170.94277@fledge.watson.org> <4C37713D.5060202@FreeBSD.org>

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


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.
> 
> 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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A28A601-C87F-47C6-8CBE-5F1BF866CA4A>