Skip to contentSkip to conversation

Autobuilder qemu process nice/ionice levels

yocto-infrastructure Richard Purdie 1 participant 1 message Sep 5, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · Richard Purdie via lists.yoctoproject.org

I have a new proposal. I think we should install a file onto the autobuilder workers as ~/runqemu-renice and on that, run "sudo setcap 'cap_sys_nice=eip'". We then add in some code to runqemu such that if this file exists, it runs it as "runqemu-renice <runqemu pid>".

Quoted 7 lines

This file will renice/ionice the specified process to -10 nice and 1/be
ionice, probably as a python script.

It should be simple, minimally invasive, backportable, as secure as it
can be and hopefully not too much trouble for Michael to setup.

I decided to test the idea. We can't use a script since the capabilities would have to be set on the interpreter so I wrote the 'renice' program in C. I've put that into autobuilder-helper:

http://git.yoctoproject.org/cgit.cgi/yocto-autobuilder-helper/tree/scripts/runqemu-renice.c

I also put a runqemu patch into -next which allows this to be used.

Michael: To enable on the autobuilders it should be a case of copying in that script (or using a copy from the helper repos which are already present), then:

gcc runqemu-renice.c -o ~/runqemu-renice
sudo setcap 'cap_sys_nice=ep' ~/runqemu-renice

Cheers,

Richard