From: "Jan Beulich" Subject: Re: [RFO] #2: removing a concurrency bottleneck Date: Fri, 20 Mar 2009 08:30:22 +0000 Message-ID: <49C3622E.76E4.0078.0@novell.com> References: <9dff6961-7b13-4447-af9c-f51deef21882@default> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <9dff6961-7b13-4447-af9c-f51deef21882@default> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer Cc: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org >>> Dan Magenheimer 19.03.09 18:52 >>> >In per-cpu, I would allocate at system initialization one >pair of buffers for each cpu (question: num_present_cpus, >num_online_cpus, or num_possible_cpus?). Then no lock >is required. It should certainly be num_possible_cpus(), which (hopefully) is identical = to num_present_cpus() until physical CPU hotplug gets supported, in which case some infrastructure will need to be added anyway so that your and other code could do such per-CPU allocations on demand. Other than Keir suggested, I'd not recommend adding further NR_CPUS sized arrays (based mostly on how long it took to mostly (fully?) get rid = of them in Linux in order to support huge systems) - just use per-CPU = pointers to dynamically allocated memory. Jan