]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
build/utils: Add BB_TASK_IONICE_LEVEL support
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 24 Oct 2015 10:19:06 +0000 (11:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Oct 2015 07:35:28 +0000 (07:35 +0000)
commitb9471ad147b102c45d65f5ffd9521864df7ff9c1
tree9a702881c9f862a78780afa1e639c04ce4b8b32e
parent335eb2db228f7543a49de71f063ac72b865c947a
build/utils: Add BB_TASK_IONICE_LEVEL support

Similarly to BB_TASK_NICE_LEVEL, add BB_TASK_IONICE_LEVEL which allows the ioprio
of tasks to be adjusted. This is in response to various qemu runtime timeouts
which have been witnessed on the autobuilder, seemingly due to IO starvation (we
already use NICE_LEVEL to adjust tasks). This has a fairly urgent need to deal
with certain 'random' failures we're seeing on the autobuilders in testing.

The format of the data in the variable is BB_TASK_IONICE_LEVEL = "<class>.<prio>".

For <class>, 2 is best effort (the default), 1 is real time and 3 is idle. You'd
need superuser privileges to use realtime. The <prio> value is a default of 4,
and can be set between 0 and 7 with 7 being lowest priority and 0 the highest.
The user can set this freely with normal privileges

Note that in order for this to take effect, you need the cfq scheduler selected
for the backing block device.

We could use nice wrapper functions for ioprio from modules like psutil however
that would complicate bitbake dependencies. This version has some magic numbers
but works on the main 32 and 64 bit x86 build architectures and can easily be
extended if ever needed. When we move to python 3.x, we can likely replace this
with standard calls.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/build.py
lib/bb/utils.py