All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan Koers <0h61vkll2ly8@xutrox.com>
To: kvm@vger.kernel.org
Subject: vhost-net guest memory usage
Date: Mon, 27 Dec 2010 21:48:19 +0100	[thread overview]
Message-ID: <4D18FB93.8000105@xutrox.com> (raw)

When running my guests with 'vhost=on', a lot less guest memory is
available (about 18.5 MB less for each networking device).

I searched the mailing list archive and found a comment by Michael S.
Tsirkin:
"with vhost, virtio does currently consume a bit more memory than with
userspace backend"

Is 18.5 MB per device the expected amount, and can I change some
setting to reduce it?


Here's the 'free' output of a guest with 7 tap devices (qemu-kvm 0.13.0,
linux 2.6.36.2 host and guest):

Started the guest with 'vhost=off':
	             total       used       free     shared    buffers     cached
	Mem:        253564      39260     214304          0       1732      15124
	-/+ buffers/cache:      22404     231160
	Swap:       409620          0     409620

Same guest, but with 'vhost=on':
	             total       used       free     shared    buffers     cached
	Mem:        253564     169092      84472          0       1744      15120
	-/+ buffers/cache:     152228     101336
	Swap:       409620          0     409620

The command that started the guest:
/opt/kvm/bin/qemu-system-x86_64 \
  -nographic \
  -daemonize \
  -cpu host \
  -M pc-0.13 \
  -m 256 \
  -mem-path /hugepages \
  -smp 2 \
  -name gw \
  -uuid d9d6332d-10ba-4cfa-925b-4e4d14f7cd86 \
  -boot c \
  -drive file=/opt/kvm/var/img/gw.raw,if=virtio,index=0,boot=on,cache=none \
  -device virtio-net-pci,netdev=virtio.0,mac=fe:60:20:3a:8d:37 \
  -netdev tap,id=virtio.0,ifname=gw-lan,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.1,mac=06:c8:4d:85:47:45 \
  -netdev tap,id=virtio.1,ifname=gw-dmz,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.2,mac=e2:57:e2:6b:67:7c \
  -netdev tap,id=virtio.2,ifname=gw-inet,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.3,mac=72:47:f5:4d:59:01 \
  -netdev tap,id=virtio.3,ifname=gw-lanv,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.4,mac=02:de:c4:7b:71:6e \
  -netdev tap,id=virtio.4,ifname=gw-dmzv,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.5,mac=fe:6a:ac:4e:16:f3 \
  -netdev tap,id=virtio.5,ifname=gw-lanvpn,script=no,downscript=no,vhost=on \
  -device virtio-net-pci,netdev=virtio.6,mac=7e:33:75:7a:ec:cd \
  -netdev tap,id=virtio.6,ifname=gw-dmzvpn,script=no,downscript=no,vhost=on \
  -serial unix:/opt/kvm/var/run/gw-serial.socket,server,nowait \
  -monitor unix:/opt/kvm/var/run/gw-monitor.socket,server,nowait \
  -parallel none \
  -vga cirrus \
  -runas kvm-gw


                 reply	other threads:[~2010-12-27 21:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4D18FB93.8000105@xutrox.com \
    --to=0h61vkll2ly8@xutrox.com \
    --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.