kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Zachary Amsden <zamsden@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM.
Date: Sun, 27 Sep 2009 10:44:40 +0200	[thread overview]
Message-ID: <4ABF25F8.3050209@redhat.com> (raw)
In-Reply-To: <4ABBD76D.6050308@redhat.com>

On 09/24/2009 11:32 PM, Zachary Amsden wrote:
> 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.

I think percpu is only allocated when the cpu is online (it would still 
be wasteful if the modules were loaded but unused).

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2009-09-27  8:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24  3:29 [PATCH: kvm 1/6] Code motion. Separate timer intialization into an indepedent function Zachary Amsden
2009-09-24  3:29 ` [PATCH: kvm 2/6] Kill the confusing tsc_ref_khz and ref_freq variables Zachary Amsden
2009-09-24  3:29   ` [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM Zachary Amsden
2009-09-24  3:29     ` [PATCH: kvm 4/6] Fix hotremove " Zachary Amsden
2009-09-24  3:29       ` [PATCH: kvm 5/6] Don't unconditionally clear cpu_khz_tsc in hardware_enable Zachary Amsden
2009-09-24  3:29         ` [PATCH: kvm 6/6] Math is hard; let's do some cooking Zachary Amsden
2009-09-24 15:52     ` [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM Marcelo Tosatti
2009-09-24 20:32       ` Zachary Amsden
2009-09-27  8:44         ` Avi Kivity [this message]
2009-09-24 15:10   ` [PATCH: kvm 2/6] Kill the confusing tsc_ref_khz and ref_freq variables Marcelo Tosatti
2009-09-25  0:47     ` Hotplug patches for KVM Zachary Amsden
2009-09-25  0:47       ` [PATCH: kvm 1/5] Code motion. Separate timer intialization into an indepedent function Zachary Amsden
2009-09-25  0:47         ` [PATCH: kvm 2/5] Kill the confusing tsc_ref_khz and ref_freq variables Zachary Amsden
2009-09-25  0:47           ` [PATCH: kvm 3/5] Fix hotadd of CPUs for KVM Zachary Amsden
2009-09-25  0:47             ` [PATCH: kvm 4/5] Fix hotremove " Zachary Amsden
2009-09-25  0:47               ` [PATCH: kvm 5/5] Math is hard; let's do some cooking Zachary Amsden
2009-09-27  8:54               ` [PATCH: kvm 4/5] Fix hotremove of CPUs for KVM Avi Kivity
2009-09-28  1:42                 ` Zachary Amsden
2009-09-27  8:52             ` [PATCH: kvm 3/5] Fix hotadd " Avi Kivity
2009-09-28  1:39               ` Zachary Amsden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ABF25F8.3050209@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=zamsden@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).