From: Sam James <sam@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org, dist-kernel@gentoo.org, kernel@gentoo.org
Subject: Re: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel
Date: Wed, 12 Oct 2022 05:51:30 +0100 [thread overview]
Message-ID: <F553B0D0-EEC9-454F-9393-CB4635F55C1E@gentoo.org> (raw)
In-Reply-To: <00db410812fe3614cddbce47c559b20ebdaccbd9.camel@gentoo.org>
> On 12 Oct 2022, at 05:46, Michał Górny <mgorny@gentoo.org> wrote:
>
> 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 <sam@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).
>
> Not to mention that someone using -j32 distcc setup necessarily wants
> 32-threaded local compression.
I'll make it use XZ_OPT if present in environment to avoid clobbering, ditto zstd.
next prev parent reply other threads:[~2022-10-12 4:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 22:54 [gentoo-dev] [PATCH 1/8] kernel-2.eclass: decompress xz in parallel Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 2/8] linux-mod.eclass: compress xz/zstd " Sam James
2022-10-12 8:27 ` Ulrich Mueller
2022-10-12 16:42 ` Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 3/8] linux-mod.eclass: use pigz for parallel compression if available Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 4/8] linux-mod.eclass: improve error handling for module compression Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 5/8] linux-mod.eclass: cleanup whitespace Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel Sam James
2022-10-12 4:46 ` Michał Górny
2022-10-12 4:51 ` Sam James [this message]
2022-10-12 8:39 ` Ulrich Mueller
2022-10-12 16:43 ` Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 7/8] kernel-build.eclass: use pigz for parallel compression if available Sam James
2022-10-11 22:54 ` [gentoo-dev] [PATCH 8/8] kernel-build.eclass: use pbzip2/lbzip2 " Sam James
2022-10-12 0:20 ` [gentoo-dev] " Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F553B0D0-EEC9-454F-9393-CB4635F55C1E@gentoo.org \
--to=sam@gentoo.org \
--cc=dist-kernel@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=kernel@gentoo.org \
--cc=mgorny@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox