From owner-freebsd-current@FreeBSD.ORG Thu Jun 10 13:05:27 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 ACF3A106564A; Thu, 10 Jun 2010 13:05:27 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5BB8FC1B; Thu, 10 Jun 2010 13:05:27 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id E70347E871; Thu, 10 Jun 2010 23:05:25 +1000 (EST) Message-ID: <4C10E312.7040600@freebsd.org> Date: Thu, 10 Jun 2010 23:05:22 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <4C10620D.7070904@freebsd.org> <201006100823.52415.jhb@freebsd.org> In-Reply-To: <201006100823.52415.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org 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 13:05:27 -0000 On 06/10/10 22:23, John Baldwin wrote: > 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. Nice, I'll rework my patch and commit once your new bits hit the tree. Cheers, Lawrence