[libvirt] cgroup memoryinfo handling

Hi 1) Daniel Smith of IBM wrote (2008) code for implementing 'virsh schedinfo' in src/util/cgroup.c He also added some code for cgroup memory subsystem (util/cgroup.c/ virCgroupSetMemoryHardLimit () etc.), I see also src/qemu_driver.c/qemuDomainSetMemoryParameters() But that seems not being invoked . I am looking at libvirt-0.8.8 2) Is anybody handling/completing this piece of code and are you libvirt guys interested in us completing it because we might find usage for that kind of 'virsh meminfo' command using cgroups . thanks Zvi Dubitzky Email:dubi@il.ibm.com

On 03/24/2011 12:04 PM, Zvi Dubitzky wrote:
Hi
1) Daniel Smith of IBM wrote (2008) code for implementing 'virsh schedinfo' in src/util/cgroup.c He also added some code for cgroup memory subsystem (util/cgroup.c/ virCgroupSetMemoryHardLimit () etc.), I see also src/qemu_driver.c/qemuDomainSetMemoryParameters() But that seems not being invoked . I am looking at libvirt-0.8.8
2) Is anybody handling/completing this piece of code and are you libvirt guys interested in us completing it because we might find usage for that kind of 'virsh meminfo' command using cgroups .
Your wish has already been mostly granted. 0.8.5 introduced the 'virsh memtune' command to both query and set memory parameters (so it wraps both qemuDomainGetMemoryParameters and qemuDomainSetMemoryParameters), and the upcoming 0.9.0 offers a few improvements to that interface as well as a counterpart 'virsh blkiotune' for the blkio cgroup. The 'virsh meminfo' command cannot easily change its output for backwards compatibility reasons, which is why we added the new functionality in 'virsh memtune' instead. You are also welcome to submit more patches or ideas for patches. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

From: Eric Blake <eblake@redhat.com> To: Zvi Dubitzky/Haifa/IBM@IBMIL Cc: libvir-list@redhat.com Date: 24/03/2011 20:22 Subject: Re: [libvirt] cgroup memoryinfo handling
On 03/24/2011 12:04 PM, Zvi Dubitzky wrote:
Hi
1) Daniel Smith of IBM wrote (2008) code for implementing 'virsh schedinfo' in src/util/cgroup.c He also added some code for cgroup memory subsystem (util/cgroup.c/ virCgroupSetMemoryHardLimit () etc.), I see also src/qemu_driver.c/qemuDomainSetMemoryParameters() But that seems not being invoked . I am looking at libvirt-0.8.8
2) Is anybody handling/completing this piece of code and are you
As per the 'virsh memtune' how are the items :hard_limit, soft_limit, min_guarantee mapped to the items mentioned in RedHat 'Resource Manangement Guide' , such as : memory.limit_in_bytes etc. thanks Zvi Dubitzky Email:dubi@il.ibm.com Eric Blake <eblake@redhat.com> wrote on 24/03/2011 20:21:40: libvirt
guys interested in us completing it because we might find usage for that kind of 'virsh meminfo' command using cgroups .
Your wish has already been mostly granted. 0.8.5 introduced the 'virsh memtune' command to both query and set memory parameters (so it wraps both qemuDomainGetMemoryParameters and qemuDomainSetMemoryParameters), and the upcoming 0.9.0 offers a few improvements to that interface as well as a counterpart 'virsh blkiotune' for the blkio cgroup.
The 'virsh meminfo' command cannot easily change its output for backwards compatibility reasons, which is why we added the new functionality in 'virsh memtune' instead.
You are also welcome to submit more patches or ideas for patches.
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[attachment "signature.asc" deleted by Zvi Dubitzky/Haifa/IBM]

On 03/24/2011 04:09 PM, Zvi Dubitzky wrote:
As per the 'virsh memtune' how are the items :hard_limit, soft_limit, min_guarantee mapped to the items mentioned in RedHat 'Resource Manangement Guide' , such as : memory.limit_in_bytes etc.
Specific support questions are probably best asked through Red Hat support channels. But the documentation currently states this: http://libvirt.org/formatdomain.html#elementsResources hard_limit The optional hard_limit element is the maximum memory the guest can use. The units for this value are kilobytes (i.e. blocks of 1024 bytes) soft_limit The optional soft_limit element is the memory limit to enforce during memory contention. The units for this value are kilobytes (i.e. blocks of 1024 bytes) swap_hard_limit The optional swap_hard_limit element is the maximum memory plus swap the guest can use. The units for this value are kilobytes (i.e. blocks of 1024 bytes). This has to be more than hard_limit value provided min_guarantee The optional min_guarantee element is the guaranteed minimum memory allocation for the guest. The units for this value are kilobytes (i.e. blocks of 1024 bytes) which should be pretty easy to map up to the corresponding cgroup controller file names like memory.limit_in_bytes. You can also browse the file src/util/cgroups.c to see which particular cgroup files are used for each limit. If you have ideas for improving the documentation, patches are welcome. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Zvi Dubitzky