public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [PATCH 4/4] Use kmem cache for allocating vcpus, simplify FPU ops
Date: Mon, 30 Jul 2007 20:04:42 +1000	[thread overview]
Message-ID: <1185789882.6131.30.camel@localhost.localdomain> (raw)
In-Reply-To: <46ADAB67.5070805-atKUWr5tajBWk0Htik3J/w@public.gmane.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/

  parent reply	other threads:[~2007-07-30 10:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30  6:31 [PATCH 1/4] vmx: pass vcpu_vmx internally Rusty Russell
     [not found] ` <1185777103.12151.147.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30  6:32   ` [PATCH 2/4] svm: pass vcpu_svm internally Rusty Russell
     [not found]     ` <1185777179.12151.149.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30  6:36       ` [PATCH 3/4] House svm.c's pop_irq and push_irq helpers into generic header Rusty Russell
     [not found]         ` <1185777368.12151.152.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30  6:39           ` [PATCH 4/4] Use kmem cache for allocating vcpus, simplify FPU ops Rusty Russell
     [not found]             ` <1185777542.12151.156.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30  9:12               ` Avi Kivity
     [not found]                 ` <46ADAB67.5070805-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-30 10:04                   ` Rusty Russell [this message]
     [not found]                     ` <1185789882.6131.30.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30 10:26                       ` Avi Kivity
     [not found]                         ` <46ADBCBC.9050207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-30 11:12                           ` [PATCH 1/2] Use kmem cache for allocating vcpus Rusty Russell
     [not found]                             ` <1185793939.6131.38.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30 11:13                               ` [PATCH 2/2] Use alignment properties of vcpu to simplify FPU ops Rusty Russell
     [not found]                                 ` <1185794023.6131.41.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30 13:09                                   ` Avi Kivity
2007-07-30  6:39           ` [PATCH 3/4] House svm.c's pop_irq and push_irq helpers into generic header Rusty Russell
2007-07-30  9:03       ` [PATCH 2/4] svm: pass vcpu_svm internally Avi Kivity
     [not found]         ` <46ADA971.9030406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-30 10:07           ` [PATCH 1/2] svm de-containization Rusty Russell
     [not found]             ` <1185790028.6131.32.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-30 10:08               ` [PATCH 2/2] svm internal function name cleanup Rusty Russell
2007-07-30 10:22               ` [PATCH 1/2] svm de-containization Avi Kivity
2007-07-30  9:02   ` [PATCH 1/4] vmx: pass vcpu_vmx internally Avi Kivity

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=1185789882.6131.30.camel@localhost.localdomain \
    --to=rusty-8n+1lvoiyb80n/f98k4iww@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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