From owner-freebsd-current@FreeBSD.ORG Thu Jun 10 12:41:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1511065678; Thu, 10 Jun 2010 12:41:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F160E8FC14; Thu, 10 Jun 2010 12:41:43 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A665346B8C; Thu, 10 Jun 2010 08:41:43 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 277FF8A04E; Thu, 10 Jun 2010 08:41:42 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 10 Jun 2010 08:23:52 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <4C10620D.7070904@freebsd.org> In-Reply-To: <4C10620D.7070904@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006100823.52415.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 10 Jun 2010 08:41:42 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Lawrence Stewart Subject: Re: [RFC] Macro to sum DPCPU vars X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 12:41:44 -0000 On Wednesday 09 June 2010 11:54:53 pm Lawrence Stewart wrote: > Does anyone have objections to or feedback on the following patch? The > macro simplifies the act of calculating an aggregate from DPCPU counters. > > http://people.freebsd.org/~lstewart/patches/tcp_ffcaia2008/dpcpu_sum_9.x.r208900.patch > > If anyone is curious how you would use it, take a look at: I think this is fine, though I'm about to make it smaller. At Robert's request I've come up with some macros to iterate over CPUs to abstract out the CPU_ABSENT(), etc. bits. It is at www.freebsd.org/~jhb/patches/cpu_iter.patch Using CPU_FOREACH() should try your macro down slightly. -- John Baldwin