From: Keir Fraser Subject: Re: [RFO] #2: removing a concurrency bottleneck Date: Thu, 19 Mar 2009 18:27:57 +0000 Message-ID: References: <9dff6961-7b13-4447-af9c-f51deef21882@default> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9dff6961-7b13-4447-af9c-f51deef21882@default> 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 , "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org On 19/03/2009 17:52, "Dan Magenheimer" wrote: > I see two solutions: cascading or per-cpu. > > 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. Just do this. A few pages per cpu is no significant overhead. I suggest you allocate the buffers and store their addresses in your own array of size NR_CPUS. You could do this from an __initcall function, or from some other boot-time init function you have handy. The percpu stuff is a bit fragile to large allocations (since we manually size the percpu region!) and you will get no real benefit from it since we do not free/alloc the percpu regions as cpus are onlined/offlined. -- keir