Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1353704pxf; Fri, 9 Apr 2021 06:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmNFaza6b3D3wRf5ZujEYqe/8mR1NFGPNFzx73+fkzs3gNzhVkoozPLNM3UF7q0f7z9mkt X-Received: by 2002:a17:902:760b:b029:e9:8bda:ae44 with SMTP id k11-20020a170902760bb02900e98bdaae44mr8711800pll.26.1617974961930; Fri, 09 Apr 2021 06:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617974961; cv=none; d=google.com; s=arc-20160816; b=xO4lFLto8kbHhde7pRqJaixzlPw6hXPOJWh1j4GFP2JrZfLa0ezIyAyc4IB9Sru5E+ 0DwUWSs0bTBfSg9qprxcVPshMksnV2KpspAClvpoouc/z05BTblgjVIWTmipB+nZOdsG 8SfTf9+zYt9xCKIK6EqIFiT1ZqxpTMqUT0E4VJsgxHap9NC6OjPmc1rZFKQ51XsrN2kg v9jc2EO+g/0wZV6svKYFjCaVS6S/Te8Jb4HxyKggTdKLTUwfq5Z9hJi2UM/MlqPZgkja 1BWWXJtBzi9N6hsESP77nZC7YwXHfq/+JtI9nY1A9bXNNXG5NDvSfDZiWMMXpz7zuIWO odlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:importance:content-transfer-encoding :mime-version:subject:message-id:cc:to:from:date:dkim-signature :dkim-signature; bh=uUwqfRRZQovNuSAqVYPSHLzpotH8r/dvuT77yNbYt7Y=; b=jCRL7HrWPGPdOLmOgrp/vGvz6Bt6741jaZNUc6ArOVRUME9nTwFwicsqWs5syRI0ht wF6/CQ5LuonD8edlTyYetS7F8qhcyFT79jg8Xp7hDp/L4Odv8H0yAe8V49mjPu8NUKe3 lFosVbHvbbt2Hg8UC0hm0hjd0J5VEPwK3oIDXgvGxs8Dga7HazTQBeN53CtAEZEv4Jpn 70aP9dZrPPGNy2Nz1MVP0DKFVAHlhoZm8a7hkjkc8g1vgcScO2+oPQpuwt7eaBoktXqX Z9hdnplFn8aWXGom8kB44rzWOAvqe5Ovi+Qv8wN6CVSyp5Y/FV6sqT3ohtyuCuidzB1Z fGxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b="T4Wu/bNn"; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=ggnIJMrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si3063895pgc.99.2021.04.09.06.29.09; Fri, 09 Apr 2021 06:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b="T4Wu/bNn"; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=ggnIJMrq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232897AbhDIN2p (ORCPT + 99 others); Fri, 9 Apr 2021 09:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbhDIN2o (ORCPT ); Fri, 9 Apr 2021 09:28:44 -0400 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F873C061760; Fri, 9 Apr 2021 06:28:31 -0700 (PDT) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4FGzV321Q0zQk1b; Fri, 9 Apr 2021 15:28:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :subject:subject:message-id:from:from:date:date:received; s= mail20150812; t=1617974904; bh=AgkOpgV5Fc2cPWeeeC5cK0+Ypi2yAhdE9 Uac+kPGrzc=; b=T4Wu/bNnhNYsUOtcgSJazMb/y5I1b3Ce96kTU+gsw2tlvKY1U C7oT7eNe2TNkY+85Y5AChoS6usxJ8vqJvElp4G7zZe0VZOYbOfKt+loAUvUZM4Cn 5sMwGKrK1F8cwxwd7POln/DEeeOhAwR9CD5G1RjSsVVMpRuDAoo1YhuroQoMPCIP 0tuDlp+cNgrJy3CBtbBOI0YgwzoqO3ldFHWz5t42HDjrYOot5lxO5l7vuILdwh44 0Sf23ppWOM3ToO9xBDfBXQhQ7VM298zYwDDvyJTGouq1di2Vfnz3yw31pKXML7M5 mYrCqzMKLQDhrevE6qlMXH+Gk4VzoDWK0RzEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1617974905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uUwqfRRZQovNuSAqVYPSHLzpotH8r/dvuT77yNbYt7Y=; b=ggnIJMrq8JeAkWx/XwKMp+hrYzFxFPAm5YpzqFEbHU7e7+HNyh6r5ub5ppVAS53I9WCI++ cpK3EMehBiWKktm5ZZSfkEUJVtQatPkD+MefXpWRt+099g3QTNxK2UFHmNfV6B2zdJg1WL R+H4RTkPJtTOqRgYtpjCheTSxCjZXSDwHokJeoJCyWtK5yQj08XEh9kUhkCfFFptsi4/ha woPIL0sU8Q4k0ncuR0d8NKZTNlF6QSChPP2Z48S3RSJ5hVs+C1DK1rck+I0Y2rytL4OfO+ fsOGADaZOZggD7Hb2CDt5Dcek8oROD+D/ZMebQOuL1VGVx6VL07Mv65M4FneaA== X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id RFvgcGJvakMQ; Fri, 9 Apr 2021 15:28:24 +0200 (CEST) Date: Fri, 9 Apr 2021 15:28:23 +0200 (CEST) From: torvic9@mailbox.org To: "linux-kbuild@vger.kernel.org" , "masahiroy@kernel.org" Cc: "linux-kernel@vger.kernel.org" , =?UTF-8?Q?Piotr_G=C3=B3rski?= Message-ID: <1557177615.69331.1617974903770@office.mailbox.org> Subject: [PATCH 1/2] kbuild: allow setting zstd compression level for modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-MBO-SPAM-Probability: X-Rspamd-Score: -2.80 / 15.00 / 15.00 X-Rspamd-Queue-Id: 64A7117FA X-Rspamd-UID: 9b2d7a Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zstd offers a very fine-grained control of compression ratios. Add a Kconfig option that allows setting the desired compression level for module compression. Based on Masahiro's linux-kbuild. Signed-off-by: Tor Vic Tested-by: Piotr Gorski --- init/Kconfig | 8 ++++++++ scripts/Makefile.modinst | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index b5744d32c..15bb02c24 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2275,6 +2275,14 @@ config MODULE_COMPRESS_ZSTD endchoice +config MODULE_COMPRESS_ZSTD_LEVEL + int "Compression level (1-19)" + depends on MODULE_COMPRESS_ZSTD + range 1 19 + default 3 + help + Compression level used by zstd for compressing modules. + config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS bool "Allow loading of modules with missing namespace imports" help diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index ff9b09e4c..0a0db2278 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -97,7 +97,7 @@ quiet_cmd_gzip = GZIP $@ quiet_cmd_xz = XZ $@ cmd_xz = $(XZ) --lzma2=dict=2MiB -f $< quiet_cmd_zstd = ZSTD $@ - cmd_zstd = $(ZSTD) -T0 --rm -f -q $< + cmd_zstd = $(ZSTD) -$(CONFIG_MODULE_COMPRESS_ZSTD_LEVEL) -T0 --rm -f -q $< $(dst)/%.ko.gz: $(dst)/%.ko FORCE $(call cmd,gzip) -- 2.31.1