[libvirt] [PATCH 3/8] qemu: Fix memory locking limit calculation

Martin Kletzander mkletzan at redhat.com
Mon Mar 27 13:42:32 UTC 2017


On Mon, Mar 27, 2017 at 03:17:12PM +0200, Andrea Bolognani wrote:
>On Mon, 2017-03-27 at 14:24 +0200, Martin Kletzander wrote:
>[...]
>> > @@ -6220,10 +6220,13 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def)
>> >         goto done;
>> >     }
>>>> > -    if (def->mem.locked) {
>> > -        memKB = virDomainDefGetMemoryTotal(def) + 1024 * 1024;
>> > -        goto done;
>> > -    }
>> > +    /* If the guest wants its memory to be locked, we need to raise the memory
>> > +     * locking limit so that the OS will not refuse allocation requests;
>> > +     * however, there is no reliable way for us to figure out how much memory
>> > +     * the QEMU process will allocate for its own use, so our only way out is
>> > +     * to remove the limit altogether. Use with extreme care */
>> > +    if (def->mem.locked)
>> > +        return VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
>> 
>> So there is no way how one can limit the size of the memlock, other than
>> setting the hard limit?
>
>Correct.
>
>> Are you planning on adding new element to the
>> domain XML which would allow setting this number as well?
>
>I do. Unless I forget about it again, of course :)
>

Well, honestly, then I feel really bad about forcing people do different
choices and changing it between releases.  I don't think anyone wants to
be checking all documentation changes every release.  But since there
are only two releases with the patch being in, it's probably okay.  But
I would *at least* be nice to mention that the lock limit is on it's way
to the XML.

>-- 
>Andrea Bolognani / Red Hat / Virtualization
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170327/d25bf883/attachment-0001.sig>


More information about the libvir-list mailing list