Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: dist-kernel@g.o, kernel@g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel
Date: Wed, 12 Oct 2022 16:44:01
Message-Id: 871qrdngae.fsf@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel by "Michał Górny"
1 Michał Górny <mgorny@g.o> writes:
2
3 > On Tue, 2022-10-11 at 23:54 +0100, Sam James wrote:
4 >> Note that this will only take effect if compressing
5 >> modules with xz or zstd (COMPRESS_MODULE_XZ is set or
6 >> COMPRESS_MODULE_ZSTD is set respectively)
7 >>
8 >> ... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ
9 >> or COMPRESS_KERNEL_ZSTD is set respectiely).
10 >>
11 >> Signed-off-by: Sam James <sam@g.o>
12 >> ---
13 >> eclass/kernel-build.eclass | 10 +++++++++-
14 >> 1 file changed, 9 insertions(+), 1 deletion(-)
15 >>
16 >> diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
17 >> index 98a385bf72c0..936258e9e8af 100644
18 >> --- a/eclass/kernel-build.eclass
19 >> +++ b/eclass/kernel-build.eclass
20 >> @@ -29,7 +29,7 @@ esac
21 >>
22 >> PYTHON_COMPAT=( python3_{8..11} )
23 >>
24 >> -inherit python-any-r1 savedconfig toolchain-funcs kernel-install
25 >> +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kernel-install
26 >>
27 >> BDEPEND="
28 >> ${PYTHON_DEPS}
29 >> @@ -90,6 +90,14 @@ kernel-build_src_configure() {
30 >> ARCH=$(tc-arch-kernel)
31 >> )
32 >>
33 >> + if type -P xz ; then
34 >> + export XZ_OPT="-T$(makeopts_jobs)"
35 >> + fi
36 >> +
37 >> + if type -P zstd ; then
38 >> + export ZSTD_NBTHREADS="$(makeopts_jobs)"
39 >> + fi
40 >> +
41 >> restore_config .config
42 >> [[ -f .config ]] || die "Ebuild error: please copy default config into .config"
43 >>
44 >
45 > I'm think that we need an override for these values. Just because
46 > someone is using -j12 to compile source files in parallel (which has no
47 > real drawback), it doesn't mean that that person wants to use 12-thread
48 > parallel xz/zstd that will actually reduce compression ratio for minimal
49 > gain (I mean, most of these files won't even use parallel compression
50 > because they're too small).
51
52 Note that >= xz-5.3.3_alpha defaults to the threaded compressor
53 anyway, just with -j1 and the difference is tiny.

Attachments

File name MIME type
signature.asc application/pgp-signature