From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721AbYIZW2S (ORCPT ); Fri, 26 Sep 2008 18:28:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751534AbYIZW2H (ORCPT ); Fri, 26 Sep 2008 18:28:07 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:39902 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750885AbYIZW2G (ORCPT ); Fri, 26 Sep 2008 18:28:06 -0400 Message-ID: <48DD61F4.3000704@sgi.com> Date: Fri, 26 Sep 2008 15:28:04 -0700 From: Mike Travis User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Peter Zijlstra CC: Steven Rostedt , LKML , Ingo Molnar , Thomas Gleixner , Andrew Morton , prasad@linux.vnet.ibm.com, Linus Torvalds , Mathieu Desnoyers , "Frank Ch. Eigler" , David Wilder , hch@lst.de, Martin Bligh , Christoph Hellwig , Masami Hiramatsu , Steven Rostedt , Arnaldo Carvalho de Melo Subject: Re: [PATCH v6] Unified trace buffer References: <20080925185154.230259579@goodmis.org> <20080925185236.244343232@goodmis.org> <48DC406D.1050508@redhat.com> <1222456474.16700.289.camel@lappy.programming.kicks-ass.net> In-Reply-To: <1222456474.16700.289.camel@lappy.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra wrote: > On Fri, 2008-09-26 at 14:05 -0400, Steven Rostedt wrote: >> +struct ring_buffer { >> + unsigned long size; >> + unsigned pages; >> + unsigned flags; >> + int cpus; >> + atomic_t record_disabled; >> + >> + struct mutex mutex; >> + >> + /* FIXME: this should be online CPUS */ >> + struct ring_buffer_per_cpu *buffers[NR_CPUS]; > > actually nr_possible makes sense, and you might consider always > allocating buffers (and keeping them for offlined cpus) to avoid massive > allocations/frees cpu-hotplug events. > > Mike Travis has been going over the kernel removing constructs like > this, and replacing them with dynamically allocated arrays of > nr_possible. > >> +}; The other thing to consider is using a percpu variable. Cheers, Mike