Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Abhishek Gupta <gupta59@illinois.edu>
Cc: glommer@redhat.com, kvm@vger.kernel.org
Subject: Re: Steal time in KVM
Date: Mon, 8 Oct 2012 16:39:45 -0300	[thread overview]
Message-ID: <20121008193945.GF18648@amt.cnet> (raw)
In-Reply-To: <CAAFDJAytoM3i6nPFFaEstvHG4M8EU=8Mz3HmrUQEFV3uufsb-g@mail.gmail.com>

On Mon, Oct 08, 2012 at 02:55:25AM -0500, Abhishek Gupta wrote:
> Hi,
> 
> I am trying to get the steal time with 2 VMs (each with 1 Vcpu) pinned
> to same core.
> 
> While finding documentation on this, I came across your patches and
> posts related to the implementation of this feature, so I thought it
> would be best to ask you.
> 
> I run the same application on these 2 VMs simultaneously and see the
> performance difference. I am trying to read the steal time from inside
> the guest using top, vmstat etc.
> 
> Both, top and vmstat -s report the steal time (st) as 0. I also
> checked that procps is in latest version. I am using virtio-net. I
> suspect that the steal time is not being updated well. Is there
> something which I need to configure for this to work? My Linux version
> for guest image is:
> 
> Linux server-147 2.6.35-24-virtual #42-Ubuntu SMP Thu Dec 2 05:15:26
> UTC 2010 x86_64 GNU/Linux
> 
> And /proc/cpuinfo shows i:
> 
> processor	: 0
> vendor_id	: GenuineIntel
> cpu family	: 6
> model		: 2
> model name	: QEMU Virtual CPU version 0.14.0
> stepping	: 3
> cpu MHz		: 2992.498
> cache size	: 4096 KB
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 4
> wp		: yes
> flags		: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
> pse36 clflush mmx fxsr sse sse2 syscall nx lm up rep_good pni cx16
> hypervisor lahf_lm
 bogomips	: 5984.99
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 40 bits physical, 48 bits virtual
> power management:
> 
> 
> Another question I had was that is there a way to programmatically get
> the value of steal cycles (e.g. from a  C program) ?
> Thanks,
> 
> Abhishek

Make sure CONFIG_SCHEDSTATS is enabled in your host kernel.

> On Monday, June 13, 2011 6:40:02 PM UTC-5, Glauber Costa wrote:
> > Hi,
> >
> > This series is a repost of the last series I posted about this.
> > It tries to address most concerns that were raised at the time,
> > plus makes uses of the static_branch interface to disable the
> > steal code when not in use.
> >
> >
> > Glauber Costa (7):
> >   KVM-HDR Add constant to represent KVM MSRs enabled bit
> >   KVM-HDR: KVM Steal time implementation
> >   KVM-HV: KVM Steal time implementation
> >   KVM-GST: Add a pv_ops stub for steal time
> >   KVM-GST: KVM Steal time accounting
> >   KVM-GST: adjust scheduler cpu power
> >   KVM-GST: KVM Steal time registration
> >
> >  Documentation/kernel-parameters.txt   |    4 ++
> >  Documentation/virtual/kvm/msr.txt     |   33 +++++++++++++
> >  arch/x86/Kconfig                      |   12 +++++
> >  arch/x86/include/asm/kvm_host.h       |    8 +++
> >  arch/x86/include/asm/kvm_para.h       |   15 ++++++
> >  arch/x86/include/asm/paravirt.h       |    9 ++++
> >  arch/x86/include/asm/paravirt_types.h |    1 +
> >  arch/x86/kernel/kvm.c                 |   72 +++++++++++++++++++++++++++++
> >  arch/x86/kernel/kvmclock.c            |    2 +
> >  arch/x86/kernel/paravirt.c            |    9 ++++
> >  arch/x86/kvm/x86.c                    |   60 +++++++++++++++++++++++-
> >  kernel/sched.c                        |   81 +++++++++++++++++++++++++++++----
> >  kernel/sched_features.h               |    4 +-
> >  13 files changed, 296 insertions(+), 14 deletions(-)
> >
> > --
> > 1.7.3.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
> 
> On Monday, June 13, 2011 6:40:02 PM UTC-5, Glauber Costa wrote:
> > Hi,
> >
> > This series is a repost of the last series I posted about this.
> > It tries to address most concerns that were raised at the time,
> > plus makes uses of the static_branch interface to disable the
> > steal code when not in use.
> >
> >
> > Glauber Costa (7):
> >   KVM-HDR Add constant to represent KVM MSRs enabled bit
> >   KVM-HDR: KVM Steal time implementation
> >   KVM-HV: KVM Steal time implementation
> >   KVM-GST: Add a pv_ops stub for steal time
> >   KVM-GST: KVM Steal time accounting
> >   KVM-GST: adjust scheduler cpu power
> >   KVM-GST: KVM Steal time registration
> >
> >  Documentation/kernel-parameters.txt   |    4 ++
> >  Documentation/virtual/kvm/msr.txt     |   33 +++++++++++++
> >  arch/x86/Kconfig                      |   12 +++++
> >  arch/x86/include/asm/kvm_host.h       |    8 +++
> >  arch/x86/include/asm/kvm_para.h       |   15 ++++++
> >  arch/x86/include/asm/paravirt.h       |    9 ++++
> >  arch/x86/include/asm/paravirt_types.h |    1 +
> >  arch/x86/kernel/kvm.c                 |   72 +++++++++++++++++++++++++++++
> >  arch/x86/kernel/kvmclock.c            |    2 +
> >  arch/x86/kernel/paravirt.c            |    9 ++++
> >  arch/x86/kvm/x86.c                    |   60 +++++++++++++++++++++++-
> >  kernel/sched.c                        |   81 +++++++++++++++++++++++++++++----
> >  kernel/sched_features.h               |    4 +-
> >  13 files changed, 296 insertions(+), 14 deletions(-)
> >
> > --
> > 1.7.3.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-10-08 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08  7:55 Steal time in KVM Abhishek Gupta
2012-10-08 19:39 ` Marcelo Tosatti [this message]
2012-10-08 19:42   ` Abhishek Gupta
2012-10-08 19:47     ` Abhishek Gupta
2012-10-08 20:02       ` Marcelo Tosatti
2012-10-08 20:06         ` Abhishek Gupta

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=20121008193945.GF18648@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=glommer@redhat.com \
    --cc=gupta59@illinois.edu \
    --cc=kvm@vger.kernel.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