From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FEF3C433E0 for ; Wed, 24 Jun 2020 21:22:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E370207FC for ; Wed, 24 Jun 2020 21:22:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ffK72ds8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="tCg/wFYt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E370207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X6Dn0JosfHz1mFvyszp/IoUm2Nr5syxDILcXhRV7vQU=; b=ffK72ds8abxltU93BenV1K37W xIzfw0Kd4A0gEm/uaA3RTSz9cNrgNyaBsAuuIeUmBBeh9Se5Pclh8wgxZ8sD5ju4X+2mRZXFiUNhG 6BBglETFPxzUIvgMiZ+wqY6SsPGT+t1mvzQpePCCq1bWLpqzTguPHtjwM0N7AhPM+9tCQR/5dyOs8 QSsTYeFH9fiUZu0lUGA6Xd1UhbU/3rVt/XIE8oVthKO1DjaKvo9mqsmEu8eXOdredWQ1Bmt3ePBDV wBFaajpJdqZsX7AnGdkxblTd6YpG4MkYWWMyRRZ1JcGe0uX4Ze2PG64URCdXwfn2TY9b4ZDLysKr5 +m0dmcS5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joCpJ-0004tm-JK; Wed, 24 Jun 2020 21:21:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joCpG-0004st-TS for linux-arm-kernel@merlin.infradead.org; Wed, 24 Jun 2020 21:20:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jL5/nBQ2OUP0iahePtvie+O7JpbFb9Sg2cWrP7q25CU=; b=tCg/wFYtRwvv+wLp9PXDSfPdmx 05NfkblFR1fTK0rTrKIOXZGlXZ+JCANTa1zrKQbLvzxUN8BLw2M1X+2KYUk3piceBuyoZSqhQIJLX BmiRFl6Mw00wYlENMfdTE5tCN9J+uAiMiMhCC9zMR7poqnCgl97vg6/iexEfNsjUqD7YUz57hK5wa zUbF285iGX8+ETEk4lhuQ53Ajdkurwj1DNy8jcWRRbScXubcskSeUi6aAeV5gqR0NXzuqYeVfjl5W kuvvVNo2h26+DJDawt8+bqb0a15CxZeoBoHxXeE/9SI5cv/tVhPiBJvvk6jL6XXXVfZnkMsujW67G qNdoj+fQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1joCpE-0004cG-FE; Wed, 24 Jun 2020 21:20:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0B4FC301A7A; Wed, 24 Jun 2020 23:20:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id ED0F1203CDC50; Wed, 24 Jun 2020 23:20:55 +0200 (CEST) Date: Wed, 24 Jun 2020 23:20:55 +0200 From: Peter Zijlstra To: Sami Tolvanen Subject: Re: [PATCH 06/22] kbuild: lto: limit inlining Message-ID: <20200624212055.GU4817@hirez.programming.kicks-ass.net> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-7-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624203200.78870-7-samitolvanen@google.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, Kees Cook , "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Greg Kroah-Hartman , Masahiro Yamada , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, George Burgess IV , linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 01:31:44PM -0700, Sami Tolvanen wrote: > This change limits function inlining across translation unit > boundaries in order to reduce the binary size with LTO. > > The -import-instr-limit flag defines a size limit, as the number > of LLVM IR instructions, for importing functions from other TUs. > The default value is 100, and decreasing it to 5 reduces the size > of a stripped arm64 defconfig vmlinux by 11%. Is that also the right number for x86? What about the effect on performance? What did 6 do? or 4? > Suggested-by: George Burgess IV > Signed-off-by: Sami Tolvanen > --- > Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/Makefile b/Makefile > index 3a7e5e5c17b9..ee66513a5b66 100644 > --- a/Makefile > +++ b/Makefile > @@ -894,6 +894,10 @@ else > CC_FLAGS_LTO_CLANG := -flto > endif > CC_FLAGS_LTO_CLANG += -fvisibility=default > + > +# Limit inlining across translation units to reduce binary size > +LD_FLAGS_LTO_CLANG := -mllvm -import-instr-limit=5 > +KBUILD_LDFLAGS += $(LD_FLAGS_LTO_CLANG) > endif > > ifdef CONFIG_LTO > -- > 2.27.0.212.ge8ba1cc988-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel