]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake.conf: Set ZSTD_THREADS to half of cpu number rbt/zstd
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 9 Nov 2021 08:30:05 +0000 (16:30 +0800)
committerRobert Yang <liezhi.yang@windriver.com>
Tue, 9 Nov 2021 08:46:25 +0000 (16:46 +0800)
The original value is very easy to cause do_packge error when cpu number is
larger, for example, 128 cores and 512G mem:

error: create archive failed: cpio: write failed - Cannot allocate memory"

Set the ZSTD_THREADS to half of the CPU number can avoid the error in my
testing.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
meta/conf/bitbake.conf

index 71c1e52ad63967921a8650991a31029ad1a53480..46ebf5113f60c732ece654e236551b178e976a52 100644 (file)
@@ -833,7 +833,7 @@ XZ_DEFAULTS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}"
 XZ_DEFAULTS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS"
 
 # Default parallelism for zstd
-ZSTD_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
+ZSTD_THREADS ?= "${@int(oe.utils.cpu_count(at_least=4)/2)}"
 ZSTD_THREADS[vardepvalue] = "1"
 
 # Limit the number of threads that OpenMP libraries will use. Otherwise they