From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 89101158020 for ; Wed, 12 Oct 2022 04:51:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4638DE095A; Wed, 12 Oct 2022 04:51:45 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1280DE0952 for ; Wed, 12 Oct 2022 04:51:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Sam James Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply Mime-Version: 1.0 (1.0) Subject: Re: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel Date: Wed, 12 Oct 2022 05:51:30 +0100 Message-Id: References: <00db410812fe3614cddbce47c559b20ebdaccbd9.camel@gentoo.org> Cc: gentoo-dev@lists.gentoo.org, dist-kernel@gentoo.org, kernel@gentoo.org In-Reply-To: <00db410812fe3614cddbce47c559b20ebdaccbd9.camel@gentoo.org> To: =?utf-8?Q?Micha=C5=82_G=C3=B3rny?= X-Mailer: iPhone Mail (20A392) X-Archives-Salt: 0b701b9d-3d80-4fe7-a6f6-93bb4d757fe8 X-Archives-Hash: 8add303a00c5c0a694361e40707ff459 > On 12 Oct 2022, at 05:46, Micha=C5=82 G=C3=B3rny wrote= : >=20 > =EF=BB=BFOn 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) >>=20 >> ... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ >> or COMPRESS_KERNEL_ZSTD is set respectiely). >>=20 >> Signed-off-by: Sam James >> --- >> eclass/kernel-build.eclass | 10 +++++++++- >> 1 file changed, 9 insertions(+), 1 deletion(-) >>=20 >> 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 >>=20 >> PYTHON_COMPAT=3D( python3_{8..11} ) >>=20 >> -inherit python-any-r1 savedconfig toolchain-funcs kernel-install >> +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kernel= -install >>=20 >> BDEPEND=3D" >> ${PYTHON_DEPS} >> @@ -90,6 +90,14 @@ kernel-build_src_configure() { >> ARCH=3D$(tc-arch-kernel) >> ) >>=20 >> + if type -P xz ; then >> + export XZ_OPT=3D"-T$(makeopts_jobs)" >> + fi >> + >> + if type -P zstd ; then >> + export ZSTD_NBTHREADS=3D"$(makeopts_jobs)" >> + fi >> + >> restore_config .config >> [[ -f .config ]] || die "Ebuild error: please copy default config into= .config" >>=20 >=20 > 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). >=20 > 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.