Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2002 01:12:30 +0100 (CET)
From:      Michal Mertl <mime@traveller.cz>
To:        "Louis A. Mamakos" <louie@TransSys.COM>
Cc:        arch@FreeBSD.ORG
Subject:   Re: 64 bit counters again 
Message-ID:  <Pine.BSF.4.41.0201210105090.94442-100000@prg.traveller.cz>
In-Reply-To: <200201202224.g0KMO8E56230@whizzo.transsys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 20 Jan 2002, Louis A. Mamakos wrote:

> If a simple spin-lock was used, then you could update an arbitrarily
> sized counter for essentially the same cost.  If you were clever
> enough in writing your device drivers, you could arrange to
> update more than one counter (e.g., packets received, octets received)
> using the same lock, with the additional counters for free.
>

That's all nice but 1) would require quite a lot of bigger changes in
kernel and 2) could sometimes create a contention for whole struct when
only one member is needed (not too probable I guess).

> This needs to be weighed against the per-CPU counters and the complexity
> associated with them.
>
> My gut feeling is that the level of contention is low enough that spin
> locks should be more than adequate to protect updating a couple of
> counters.  This assumes that spin locks have not become expensive or
> bloated to invalidate their usefulness, I suppose.

The 64 bit atomic ops on i386 work probably exactly the same. I guarantee
there's no bloat :-).

>
> The larger thought is that there's this unstated assumption which
> probably needs to be state:  We have and maintain accurate statistics on
> various operations that the FreeBSD kernel performs.  For network
> elements, it's assumed that there are the typical network-interface
> stats which we also provide.  We can agonize over the cost of having
> to implement all these statistics, but I'd claim that the kernel
> is defective if it doesn't do so.

I won't be that harsh - some people may need them and they have their
cost.

We have lot of servers but none of them is longer time doing more than say
10Mbit. I would consider atomic ops free in this operation.


-- 
Michal Mertl
mime@traveller.cz




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.41.0201210105090.94442-100000>