All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Antoine Martin <antoine@nagafix.co.uk>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: context switches and responsiveness
Date: Tue, 26 May 2009 12:05:11 +0300	[thread overview]
Message-ID: <4A1BB0C7.5000107@redhat.com> (raw)
In-Reply-To: <4A1BA92C.6060204@nagafix.co.uk>

Antoine Martin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
> I've recently increased the number of guests (+20%) running on one of my
> hosts and found that the responsiveness suffered.
>   

How many guests?  How many vcpus?

> Before that, the context switches were hovering around 10K, now they're
> close to 30K. Or this could just be because I upgraded the host kernel
> and kvm: host and guests are running 2.6.29.4 + kvm-86
> Is there anything that can be done to reduce this?
> I thought dynticks would prevent unecessary context switching?
>   

dynticks is the default IIRC.  What type guests are you running?

If Linux, make sure the guests are dynticks as well.

> As you can see from the dstat sample below, the host can be very quiet
> at times, and yet the guests are a bit sluggish. (there is no swapping
> going on in the guests either)
> Is 30K context switches normal for a host that's mostly idle??
>   

Depends on guest count!  Please provide kvm_stat output.

> Here is a sample guest command line:
> - -clock dynticks -usbdevice tablet -m 1024 -monitor
> telnet:127.0.0.1:10005,server,nowait -L ./ -kernel ./bzImage-2.6.29.4
> - -append  earlyprintk=serial,ttyS0,115200,keep console=ttyS0,115200
>   

Ah, -usbdevice tablet, interrupt generator from hell.  Let it go and 
you'll see your context switch rate drop.

> - ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
> usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
>  14  15  71   0   0   0|   0     0 | 942B 6912B|   0     0 |  20k   29k
>  11  17  71   0   0   0|   0   160k| 460B  818B|   0     0 |  19k   30k
>   

Interrupt rate is close to context switch rate, which is good.


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-05-26  9:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  8:32 context switches and responsiveness Antoine Martin
2009-05-26  9:05 ` Avi Kivity [this message]
2009-05-26  9:37   ` context switches and responsiveness [SOLVED] Antoine Martin
2009-05-26  9:39     ` Avi Kivity
2009-05-26  9:41       ` Antoine Martin
2009-05-26 10:01         ` 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=4A1BB0C7.5000107@redhat.com \
    --to=avi@redhat.com \
    --cc=antoine@nagafix.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.