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 362D2158020 for ; Wed, 12 Oct 2022 16:44:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 904DAE0971; Wed, 12 Oct 2022 16:43:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 57DE1E08F6 for ; Wed, 12 Oct 2022 16:43:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 9B069341083; Wed, 12 Oct 2022 16:43:57 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Flag: NO X-Spam-Score: 2.237 X-Spam-Level: ** X-Spam-Status: No, score=2.237 tagged_above=-9999 required=5.5 tests=[AWL=-0.002, BAYES_00=-1.9, RCVD_IN_PBL=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01] autolearn=no autolearn_force=no Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Fr6wXwe0epa; Wed, 12 Oct 2022 16:43:56 +0000 (UTC) Received: from mop.sam.mop (unknown [82.8.138.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3E20C341081; Wed, 12 Oct 2022 16:43:55 +0000 (UTC) References: <20221011225444.56032-1-sam@gentoo.org> <20221011225444.56032-6-sam@gentoo.org> <00db410812fe3614cddbce47c559b20ebdaccbd9.camel@gentoo.org> User-agent: mu4e 1.8.10; emacs 29.0.50 From: Sam James To: gentoo-dev@lists.gentoo.org Cc: dist-kernel@gentoo.org, kernel@gentoo.org, =?utf-8?B?TWljaGHFgiBHw7Ny?= =?utf-8?B?bnk=?= Subject: Re: [gentoo-dev] [PATCH 6/8] kernel-build.eclass: compress xz/zstd in parallel Date: Wed, 12 Oct 2022 17:43:21 +0100 In-reply-to: <00db410812fe3614cddbce47c559b20ebdaccbd9.camel@gentoo.org> Message-ID: <871qrdngae.fsf@gentoo.org> 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Archives-Salt: a210904c-e699-4ebe-b880-92641788fc1f X-Archives-Hash: 307a98b3920a7a8bf0e4511d0e63853a --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Micha=C5=82 G=C3=B3rny 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) >>=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=20 >> PYTHON_COMPAT=3D( python3_{8..11} ) >>=20=20 >> -inherit python-any-r1 savedconfig toolchain-funcs kernel-install >> +inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kerne= l-install >>=20=20 >> BDEPEND=3D" >> ${PYTHON_DEPS} >> @@ -90,6 +90,14 @@ kernel-build_src_configure() { >> ARCH=3D$(tc-arch-kernel) >> ) >>=20=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). Note that >=3D xz-5.3.3_alpha defaults to the threaded compressor anyway, just with -j1 and the difference is tiny. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY0buyV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZDkwAD6AuDtYraDom93Qq35W+mEuu9o2qoP6EiXstdf Ta/LUC4A/2y1N5R+gnop8Jf0BRSYaGRBMSBZh1WgURTdYzLYT7EI =8umK -----END PGP SIGNATURE----- --=-=-=--