public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Freddie Cash <fjwcash@gmail.com>
Cc: KVM mailing list <kvm@vger.kernel.org>
Subject: Re: Memory leaks in virtio drivers?
Date: Sat, 27 Nov 2010 00:00:51 +0300	[thread overview]
Message-ID: <4CF02003.2050802@msgid.tls.msk.ru> (raw)
In-Reply-To: <AANLkTi=Az_-dS8v0c99JN2V4uedDies6RUM0PuFQ04Oa@mail.gmail.com>

26.11.2010 22:19, Freddie Cash wrote:
> Are there still known memory leaks in the virtio block and/or net
> drivers?  If not, have we found one?
> 
> This is our host setup:
>   - Tyan h2000M motherboard
>   - 2x dual-core AMD Opteron 2220 CPUs
>   - 16 GB RAM
>   - quad-port NIC bonded together into 1 kvmbr0 interface
>   - 3Ware 9550SXU-12ML RAID controller
>   - 12x 400 GB SATA drives (4-disk RAID5, 4-disk RAID5, 3-disk RAID5,
> spare disk)
>   - LVM used to stitch the 3 arrays into one volume group
> 
> Running 64-bit Debian 5.0 (Lenny), using qemu-kvm0.12.4 and kernel
> 2.6.32 from lenny-backports.

There were some memleaks in i/o paths fixed in 0.12 series of kvm.
In particular, 0.12.4 upstream version had a memory leak in virtio_blk,
but that bug isn't present in 0.12.4+dfsg-1 - first 0.12.4 version as
appeared in debian (the fix included upstream in 0.12.5).  I know no
other memleaks in later 0.12 series which aren't fixed in debian.

> Guests are Ubuntu Server 8.04 LTS, Debian Lenny, Windows XP, and Windows 2003.

For debian lenny guests using virtio, consider switching to
backports 2.6.32 kernel too - lenny's 2.6.26 has several
defects in virtio implementation.

> All of the Linux VMs use virtio for both network and disk.
> All the Windows VMs use virtio for network and IDE emulation for disk.
> 
> Within 2 weeks of booting, the host machine is using 2 GB of swap, and
> disk I/O wait is through the roof.  Restarting all of the VMs will
> free up RAM, but restarting the whole box is the only way to get
> performance back up.
> 
> A guest configured to use 8 GB of RAM will have 9 GB virt and 7.5 GB
> res shown in top.  In fact, every single VM shows virt above the limit
> set for the VM.  Usually by close to 25%.
> 
> Going back through the mailing list archives and bug archives, there's
> been mention of several memory leaks in the virtio drivers back to
> KVM-72.  Last bug report I read shows them all being fixed in 0.12.4,
> which we're running.

Yes, 0.12.4 had that bug, but it's fixed in 0.12.4+dfsg-1.
The current version in backports is based on 0.12.5.

> Perhaps there's something wrong with our setup?  Perhaps there's still
> a leak to be found?  Perhaps this is fixed in 0.12.5 or newer?

Well, how about reading the changelog first, before asking? They're
there for a reason, right?

Speaking of your setup, in addition to what Stephen said already,
I'd strongly suggest considering hugepages - for this amount of
memory hugepages should help quite alot, and this way you'll eliminate
lots of pagetable entries.

/mjt

  parent reply	other threads:[~2010-11-26 21:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 19:19 Memory leaks in virtio drivers? Freddie Cash
2010-11-26 20:04 ` Stefan Hajnoczi
2010-11-26 20:16   ` Freddie Cash
2010-11-26 20:54     ` Stefan Hajnoczi
2010-11-26 21:14       ` Nikola Ciprich
2010-11-26 21:21       ` Freddie Cash
2010-11-26 21:00 ` Michael Tokarev [this message]
2010-11-26 21:38   ` Freddie Cash
2010-11-26 22:16     ` Michael Tokarev
2010-11-26 23:09       ` Freddie Cash
2010-11-26 23:23         ` Michael Tokarev
2010-12-01 18:16           ` Freddie Cash
2010-12-08 20:21             ` Freddie Cash

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=4CF02003.2050802@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=fjwcash@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox