From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388031AbgFXXhc (ORCPT ); Wed, 24 Jun 2020 19:37:32 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8092FC061795 for ; Wed, 24 Jun 2020 16:37:31 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id b92so2043965pjc.4 for ; Wed, 24 Jun 2020 16:37:31 -0700 (PDT) Date: Wed, 24 Jun 2020 16:37:24 -0700 From: Sami Tolvanen Subject: Re: [PATCH 06/22] kbuild: lto: limit inlining Message-ID: <20200624233724.GA94769@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-7-samitolvanen@google.com> <20200624212055.GU4817@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624212055.GU4817@hirez.programming.kicks-ass.net> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, George Burgess IV On Wed, Jun 24, 2020 at 11:20:55PM +0200, Peter Zijlstra wrote: > 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? This is the size limit we decided on for Android after testing on arm64, but the number is obviously a compromise between code size and performance. I'd be happy to benchmark this further once other concerns have been resolved. Sami