>>Another way could be use launch qemu with systemd-run, I think we can specify 
>>cgroup (slice in systemd) directly. 

for example:

systemd-run --remain-after-exit --slice=qemu --unit=100 -p CPUShares=499 
/usr/bin/kvm -id 100 ....


Seem better than hacking qemu ?


----- Mail original -----
De: "aderumier" <aderum...@odiso.com>
À: "Stefan Priebe" <s.pri...@profihost.ag>
Cc: "pve-devel" <pve-devel@pve.proxmox.com>
Envoyé: Jeudi 28 Mai 2015 15:02:36
Objet: Re: [pve-devel] qemu-server: cgroups && cpu.shares implementation

Another way could be use launch qemu with systemd-run, I think we can specify 
cgroup (slice in systemd) directly. 


----- Mail original ----- 
De: "aderumier" <aderum...@odiso.com> 
À: "Stefan Priebe" <s.pri...@profihost.ag> 
Cc: "pve-devel" <pve-devel@pve.proxmox.com> 
Envoyé: Jeudi 28 Mai 2015 13:36:25 
Objet: Re: [pve-devel] qemu-server: cgroups && cpu.shares implementation 

>>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 
_______________________________________________ 
pve-devel mailing list 
pve-devel@pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to