From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 4/4] Use kmem cache for allocating vcpus, simplify FPU ops Date: Mon, 30 Jul 2007 20:04:42 +1000 Message-ID: <1185789882.6131.30.camel@localhost.localdomain> References: <1185777103.12151.147.camel@localhost.localdomain> <1185777179.12151.149.camel@localhost.localdomain> <1185777368.12151.152.camel@localhost.localdomain> <1185777542.12151.156.camel@localhost.localdomain> <46ADAB67.5070805@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: In-Reply-To: <46ADAB67.5070805-atKUWr5tajBWk0Htik3J/w@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 On Mon, 2007-07-30 at 12:12 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > If we use a kmem cache for allocating vcpus, we can get the 16-byte > > alignment required by fxsave & fxrstor instructions, and avoid > > manually aligning the buffer. > > Please separate the slabification from the fpu cleanups into separate > patches. Hmm, are you trying to get my patch count up? > > static int __init svm_init(void) > > { > > - return kvm_init_arch(&svm_arch_ops, THIS_MODULE); > > + int err; > > + > > + /* A kmem cache lets us meet the alignment requirements of fx_save. */ > > + svm_kmem_cache = KMEM_CACHE(vcpu_svm, 0); > > > > kvm slab caches are prefixed with kvm_; this makes it easy to 'grep kvm > /proc/slabinfo' to see kvm leaks. Please preserve that. How horrible. We'd be better with KMEM_CACHE() prefixing the module name. I'll change this to use the manual "non-recommended" way for the moment and submit a patch later. > Also, the allocation and destruction can be in common code, reducing the > amount of rarely-executed error paths. Sure, we could pass the size into the core so it can allocate the slab cache, then have the core do the allocation itself (undoing the recent create_vcpu change). Is it worth it? Rusty. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/