Michał Górny <mgo...@gentoo.org> writes:

> On Tue, 2022-10-11 at 23:54 +0100, Sam James wrote:
>> Note that this will only take effect if compressing
>> modules with xz or zstd (COMPRESS_MODULE_XZ is set or
>> COMPRESS_MODULE_ZSTD is set respectively)
>> 
>> ... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ
>> or COMPRESS_KERNEL_ZSTD is set respectiely).
>> 
>> Signed-off-by: Sam James <s...@gentoo.org>
>> ---
>>  eclass/kernel-build.eclass | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
>> index 98a385bf72c0..936258e9e8af 100644
>> --- a/eclass/kernel-build.eclass
>> +++ b/eclass/kernel-build.eclass
>> @@ -29,7 +29,7 @@ esac
>>  
>>  PYTHON_COMPAT=( python3_{8..11} )
>>  
>> -inherit python-any-r1 savedconfig toolchain-funcs kernel-install
>> +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs 
>> kernel-install
>>  
>>  BDEPEND="
>>      ${PYTHON_DEPS}
>> @@ -90,6 +90,14 @@ kernel-build_src_configure() {
>>              ARCH=$(tc-arch-kernel)
>>      )
>>  
>> +    if type -P xz ; then
>> +            export XZ_OPT="-T$(makeopts_jobs)"
>> +    fi
>> +
>> +    if type -P zstd ; then
>> +            export ZSTD_NBTHREADS="$(makeopts_jobs)"
>> +    fi
>> +
>>      restore_config .config
>>      [[ -f .config ]] || die "Ebuild error: please copy default config into 
>> .config"
>>  
>
> I'm think that we need an override for these values.  Just because
> someone is using -j12 to compile source files in parallel (which has no
> real drawback), it doesn't mean that that person wants to use 12-thread
> parallel xz/zstd that will actually reduce compression ratio for minimal
> gain (I mean, most of these files won't even use parallel compression
> because they're too small).

Note that >= xz-5.3.3_alpha defaults to the threaded compressor
anyway, just with -j1 and the difference is tiny.

Attachment: signature.asc
Description: PGP signature

Reply via email to