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>
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