Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 2013 14:05:33 -0500
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: [CFR][CFT] counter(9): new API for faster and raceless counters
Message-ID:  <20130403190533.GA97453@lor.one-eyed-alien.net>
In-Reply-To: <20130401115128.GZ76816@FreeBSD.org>
References:  <20130401115128.GZ76816@FreeBSD.org>

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

--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 01, 2013 at 03:51:28PM +0400, Gleb Smirnoff wrote:
> o Tiny API for counter(9):
>=20
>      counter_u64_t
>      counter_u64_alloc(int wait);
>=20
>      void
>      counter_u64_free(counter_u64_t cnt);
>=20
>      void
>      counter_u64_add(counter_u64_t cnt, uint64_t inc);
>=20
>      uint64_t
>      counter_u64_fetch(counter_u64_t cnt);

I wonder if there might be value in an interface to retrieve the per-cpu
values individually.  The use case I have in mind is interrupt counters
on our BERI CPU.  Similar to the Sibyte MIPS SoCs, our PIC always routes
each interrupt to a specific hardware thread.  I'd ideally like to be able
to look at at hardware interrupts on a per-thread basis and avoid the
cache trashing behavior we'd get if we allocated current interrupt
counters to each one, but we probably want to be able to preserve
something like the current behavior.

-- Brooks

--cWoXeonUoKmBZSoM
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iD8DBQFRXH19XY6L6fI4GtQRAgw4AKCFFv5Avxk+GygNi9wfjRUjjXHWfQCaAj89
jGFJUk7SrxddS/AwpUF2UvY=
=gVnZ
-----END PGP SIGNATURE-----

--cWoXeonUoKmBZSoM--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130403190533.GA97453>