]> code.ossystems Code Review - openembedded-core.git/commit
sstate.bbclass: get the number of threads from BB_NUMBER_THREADS
authorJose Quaresma <quaresma.jose@gmail.com>
Wed, 18 Aug 2021 20:29:53 +0000 (21:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Aug 2021 07:51:08 +0000 (08:51 +0100)
commit45c52f08a289c6eb2329de50634a0406204d1d8e
tree608d31977686d0f69e6537b1ba88ea2446e5b466
parent90141d41a370ff377d95fb3dd144b63a85e22f8e
sstate.bbclass: get the number of threads from BB_NUMBER_THREADS

- bitbake BB_NUMBER_THREADS uses cpu_count from oe utils that uses
the python os.sched_getaffinity and it is more acurrate.

 grep -nH ^BB_NUMBER_THREADS meta/conf/bitbake.conf
 meta/conf/bitbake.conf:806:BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"

- multiprocessing.cpu_count() returns the number of CPUs on the host,
not the number of usable CPUs on the host. If the user is using
scheduler affinity then the number of usable CPUs may be less,
so when determining how many cores we can use check the affinity instead.

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass