>>Not tested but what about this: >> >>fork() >># in child >>put current pid into cgroup >>exec kvm
Yes, I think it should work, if we put the pid of the forked process in cgroups. Other child threads should go automaticaly to the parent cgroup. I have done tests with hotplug virtio-net with vhost threads, or iothread drive, and their threads pid go to the cgroup. ----- Mail original ----- De: "Stefan Priebe" <s.pri...@profihost.ag> À: "dietmar" <diet...@proxmox.com>, "aderumier" <aderum...@odiso.com>, "pve-devel" <pve-devel@pve.proxmox.com> Envoyé: Jeudi 28 Mai 2015 12:55:29 Objet: Re: [pve-devel] qemu-server: cgroups && cpu.shares implementation Am 28.05.2015 um 12:51 schrieb Dietmar Maurer: >> Here the patches serie for implemtation of cpuunits through cgroups > > If you implement it inside qemu-server you have a race-condition, because > you do it too late and qemu already started the threads? Or maybe only parts > of necessary threads are already created? > > So wouldn't it be easier to do it inside qemu? Not tested but what about this: fork() # in child put current pid into cgroup exec kvm # parent ... <= wouldn't this put all threads kvm creates automatically into the right cgroup? Stefan _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel