From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Amsden Subject: Re: [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM. Date: Thu, 24 Sep 2009 10:32:45 -1000 Message-ID: <4ABBD76D.6050308@redhat.com> References: <1253762945-5750-1-git-send-email-zamsden@redhat.com> <1253762945-5750-2-git-send-email-zamsden@redhat.com> <1253762945-5750-3-git-send-email-zamsden@redhat.com> <20090924155224.GC14102@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Avi Kivity To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41803 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbZIXUes (ORCPT ); Thu, 24 Sep 2009 16:34:48 -0400 In-Reply-To: <20090924155224.GC14102@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 09/24/2009 05:52 AM, Marcelo Tosatti wrote: > >> +static __cpuinit int vmx_cpu_hotadd(int cpu) >> +{ >> + struct vmcs *vmcs; >> + >> + if (per_cpu(vmxarea, cpu)) >> + return 0; >> + >> + vmcs = alloc_vmcs_cpu(cpu); >> + if (!vmcs) >> + return -ENOMEM; >> + >> + per_cpu(vmxarea, cpu) = vmcs; >> + >> + return 0; >> +} >> > Have to free in __cpuexit? > > Is it too wasteful to allocate statically with DEFINE_PER_CPU_PAGE_ALIGNED? > Unfortunately, I think it is. The VMX / SVM structures are quite large, and we can have a lot of potential CPUs. Zach