From owner-freebsd-arch@FreeBSD.ORG Wed Apr 3 19:05:35 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D01891AF; Wed, 3 Apr 2013 19:05:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 3D43185D; Wed, 3 Apr 2013 19:05:35 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r33J5Xai098600; Wed, 3 Apr 2013 14:05:33 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r33J5XMV098599; Wed, 3 Apr 2013 14:05:33 -0500 (CDT) (envelope-from brooks) Date: Wed, 3 Apr 2013 14:05:33 -0500 From: Brooks Davis To: Gleb Smirnoff Subject: Re: [CFR][CFT] counter(9): new API for faster and raceless counters Message-ID: <20130403190533.GA97453@lor.one-eyed-alien.net> References: <20130401115128.GZ76816@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20130401115128.GZ76816@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 19:05:35 -0000 --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--