]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Slightly increase memory limit
authorJiri Denemark <jdenemar@redhat.com>
Mon, 8 Jul 2013 13:12:27 +0000 (15:12 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 11 Jul 2013 09:17:47 +0000 (11:17 +0200)
For low-memory domains (roughly under 400MB) our automatic memory limit
computation comes up with a limit that's too low. This is because the
0.5 multiplication does not add enough for such small values. Let's
increase the constant part of the computation to fix this.

src/qemu/qemu_domain.c

index ab2e68070d1991af04e6bd6f40a150aadbde9df2..06efe148df5fc4a35ca2dfe4d3fb9edf6ac466f1 100644 (file)
@@ -2178,7 +2178,7 @@ qemuDomainMemoryLimit(virDomainDefPtr def)
          * limit' has been chosen:
          *     (1 + k) * (domain memory + total video memory) + (32MB for
          *     cache per each disk) + F
-         * where k = 0.5 and F = 200MB.  The cache for disks is important as
+         * where k = 0.5 and F = 400MB.  The cache for disks is important as
          * kernel cache on the host side counts into the RSS limit.
          * Moreover, VFIO requires some amount for IO space. Alex Williamson
          * suggested adding 1GiB for IO space just to be safe (some finer
@@ -2193,7 +2193,7 @@ qemuDomainMemoryLimit(virDomainDefPtr def)
             mem += def->videos[i]->vram;
         mem *= 1.5;
         mem += def->ndisks * 32768;
-        mem += 204800;
+        mem += 409600;
 
         for (i = 0; i < def->nhostdevs; i++) {
             virDomainHostdevDefPtr hostdev = def->hostdevs[i];