[libvirt] [PATCH V2] qemu: Redefine the "unlimited" memory limits one more time

Martin Kletzander mkletzan at redhat.com
Fri Nov 25 16:12:41 UTC 2016


On Fri, Nov 25, 2016 at 03:39:17PM +0000, Daniel P. Berrange wrote:
>On Fri, Nov 25, 2016 at 04:35:14PM +0100, Martin Kletzander wrote:
>> On Fri, Nov 25, 2016 at 03:19:54PM +0100, Viktor Mihajlovski wrote:
>> > On 18.11.2016 17:44, Viktor Mihajlovski wrote:
>> > > With kernel 3.18 (since commit 3e32cb2e0a12b6915056ff04601cf1bb9b44f967) the
>> > > "unlimited" value for cgroup memory limits has changed once again as its byte
>> > > value is now computed from a page counter.
>> > > The new "unlimited" value reported by the cgroup fs is therefore 2**51-1 pages
>> > > which is (VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - 3072). This results e.g. in virsh
>> > > memtune displaying 9007199254740988 instead of unlimited for the limits.
>> > >
>>
>> Ah, I wonder hoe many times we'll have to deal with this.
>>
>> Anyway, this means it is not enough to shift by 2 if the system hugepage
>> is more than 4k (e.g. 2M).  I remember we had to change something due to
>> such hosts.  virGetSystemPageSize(KB) should help with that.
>>
>> We could also make it 2^50 - pagesize just to make sure it will work for
>> a while, but some might not like it.
>
>I guess I'm not understanding how this code copes with the fact that
>we now have 3 different "unlimited" values to deal with.
>
>Could we not simply record the unlimited values and pick the right
>one based on kernel version we detect ?
>

We have one, which we return for Get APIs that means that the setting
was not restricted.  We would need to have a cgroup which we set to
some huge value and then read it, store it and compare it all the time.
It _should_ work as far as I can tell.

>Regards,
>Daniel
>--
>|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
>|: http://libvirt.org              -o-             http://virt-manager.org :|
>|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
-------------- 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/20161125/ca14d806/attachment-0001.sig>


More information about the libvir-list mailing list