Re: cgroup limits only affect kvm guest under certain conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 06 Jan 2011 14:15:37 +0100
Dominik Klein <dk@xxxxxxxxxxxxxxxx> wrote:

> Hi
> 
> I am playing with cgroups and try to limit block io for guests.
> 
> The proof of concept is:
> 
> # mkdir /dev/cgroup/blkio
> # mount -t cgroup -o blkio blkio /dev/cgroup/blkio/
> # cd blkio/
> # mkdir test
> # cd test/
> # ls -l /dev/vdisks/kirk
> lrwxrwxrwx 1 root root 7 2011-01-06 13:46 /dev/vdisks/kirk -> ../dm-5
> # ls -l /dev/dm-5
> brw-rw---- 1 root disk 253, 5 2011-01-06 13:36 /dev/dm-5
> # echo "253:5  1048576" > blkio.throttle.write_bps_device
> # echo $$ > tasks
> # dd if=/dev/zero of=/dev/dm-5 bs=1M count=20
> 20+0 records in
> 20+0 records out
> 20971520 bytes (21 MB) copied, 20.0223 s, 1.0 MB/s
> 
> So limit applies to the dd child of my shell.
> 
> Now I assign /dev/dm-5 (/dev/vdisks/kirk) to a vm and echo the qemu-kvm
> pid into tasks. Limits are not applied, the guest can happily use max io
> bandwidth.
> 

qemu consists of several threads. Cgroup works per thread now.
Could you double check "all threads for qemu" are in a cgroup ?
I think you have to write all thread-ID to "tasks" file when you
move qemu after starting it.

Thanks,
-Kame


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux