From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH]0/2 Patches to furthure split kvm_init Date: Fri, 30 Nov 2007 10:36:09 +0200 Message-ID: <474FCB79.2010008@qumranet.com> References: <42DFA526FC41B1429CE7279EF83C6BDCA394B2@pdsmsx415.ccr.corp.intel.com> <474E8D88.4090508@linux.vnet.ibm.com> <474FBF0D.7020601@qumranet.com> <42DFA526FC41B1429CE7279EF83C6BDCA397B9@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Christian Ehrhardt , carsteno-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org, hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org To: "Zhang, Xiantao" Return-path: In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDCA397B9-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Zhang, Xiantao wrote: > Avi Kivity wrote: > >> Christian Ehrhardt wrote: >> >>> Hi Xiantao, >>> it looks good to me to move kvm_vcpu_cache out to the x86 specific >>> code >>> >> Why is that? Do other archs not want kvm_vcpu_cache, or is it just >> the alignment? >> > At lease we didn't fall across the similar requirements about such > alignment issues in IA64. > What I mean is, other archs do require kvm_vcpu_cache (without the alignment), so why move the code? Just make the alignment arch dependent with a #define. Oh, and since the code is written as > - /* A kmem cache lets us meet the alignment requirements of > fx_save. */ > - kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, > - __alignof__(struct kvm_vcpu), > - 0, NULL); > - if (!kvm_vcpu_cache) { If other archs don't require special alignment for kvm_vcpu, __alignof__(struct kvm_vcpu) will return the natural alignment for that arch, and no memory will be wasted. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4