Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp703202pxb; Thu, 25 Feb 2021 12:53:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYs38OYS0qwI4su7N68wp86BY54sQZz92qP6XOdmEY17sQGmnoIzriDCwTQWunwIAChksU X-Received: by 2002:aa7:db91:: with SMTP id u17mr4911656edt.71.1614286382136; Thu, 25 Feb 2021 12:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614286382; cv=none; d=google.com; s=arc-20160816; b=EcM4E7ZwqtbceipZbcUDB9b6v8riI+M2e9gkENn0Pe9kM1gJIGqy420fzco0Jd8tol Rd9+TWKrFpvBusq2KsB2xMxmUd2qDjNq/P9Kg4TBaBkGYajGlD18jYdw++HDbrRWs1yp L+tQLWPQMhnUOVvfK8l7fdQHemY/vgeZ0jy48MzxuY1ahLxthThKQJPAc3kqxRuOtolH 8ALFPleKzDbde6S4Bxy4GeKvPKlGKED+jbegelHmjKWR6DUcuER5fblwppglI5OHM3LS BfwWntgwVKlg7Ct5pMOV9vUTftSMyykDG3AjaXzbpQCKhFvzZK/4pWJWvIIKnf+fHn/U wS8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=ot3MCmRuLWlveA+YN3J5e0I22b5/0CwdS2pr5RDRZ4A=; b=xNf49IUn1YfuqkGMMYme8cbJNM6ZvnNkk4pn0Qq8FiHwvjLiAw88mVRNOr+uZy28Yb E6t7FU37QRN/yPXnKTeKl0qsEBdRVMrQHtjrkqDbwYjxcETrfzMdmC/PbRtJFJvJwsEJ SC/aI0683ru6G6X54RaTudAiaOm0fP6kJ3VFSZfvx3zqk2dAaObDUzpfx2tlDUaj+CHR QvMah1dr8vMbU+ueO1EdOaNnOxe6prHemIsOktkiv7l98Wske8W0aa/LunwYEAnS8uOU 9fq2cGavp8NATRLs6wWMPEifzk6zArUrC4DWWJcFviPym5RgQfPS2rWerlTH4lLOzJW4 df8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=H4BrwsTZ; dkim=pass header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=hh7xvP+h; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc10si4337996edb.153.2021.02.25.12.52.38; Thu, 25 Feb 2021 12:53:02 -0800 (PST) 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=@pobox.com header.s=sasl header.b=H4BrwsTZ; dkim=pass header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=hh7xvP+h; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbhBYRUW (ORCPT + 99 others); Thu, 25 Feb 2021 12:20:22 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:50724 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbhBYRUV (ORCPT ); Thu, 25 Feb 2021 12:20:21 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6399C9E9D8; Thu, 25 Feb 2021 12:19:38 -0500 (EST) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=23dtnOUfzLyDX+KW1V2mmBc/9V0=; b=H4Brws TZSHzddWSKivCGfqVGCqQ88W3DJggqpWSJQLjEH8HQsMhD2So5e5QmQkCPYj8iCy iFnpbqKYcjtW7Kdz12+s0V3KoFN+LrWYhWM7Qyc++gTHWp5Rl0StNAGNuyX4GYzr LBaQOjTiXI6bMum7/n32YuGBTJP4WakTEyfEk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 5C07A9E9D6; Thu, 25 Feb 2021 12:19:38 -0500 (EST) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=n8NygWpegxhLZX877LB3tSwxmKQuyH4sXRAP1vuz7oQ=; b=hh7xvP+hjmn279jUavnDgocmjN/Z3vnhifsJ+CMWWGXDAT6HUHjaX48/Z22fz89en00mXpoHOTRL70JxhT0wCrJT7XPEuQQSs1plC8SJ+ytH0T/AOC8/qLuOkW6UtVssSfvn3qx6jhQndnDdLLjsPHjR8ZrhjxcyY3YEyhRzpDE= Received: from yoda.home (unknown [24.203.50.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id C11A89E9D5; Thu, 25 Feb 2021 12:19:37 -0500 (EST) (envelope-from nico@fluxnic.net) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id C5C622DA0082; Thu, 25 Feb 2021 12:19:36 -0500 (EST) Date: Thu, 25 Feb 2021 12:19:36 -0500 (EST) From: Nicolas Pitre To: Masahiro Yamada cc: linux-kbuild@vger.kernel.org, Christoph Hellwig , Linus Torvalds , Jessica Yu , Sami Tolvanen , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 0/4] kbuild: build speed improvment of CONFIG_TRIM_UNUSED_KSYMS In-Reply-To: <20210225160247.2959903-1-masahiroy@kernel.org> Message-ID: References: <20210225160247.2959903-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: A343518A-778D-11EB-8355-74DE23BA3BAF-78420484!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Feb 2021, Masahiro Yamada wrote: > > Now CONFIG_TRIM_UNUSED_KSYMS is revived, but Linus is still unhappy > about the build speed. > > I re-implemented this feature, and the build time cost is now > almost unnoticeable level. > > I hope this makes Linus happy. :-) I'm surprised to see that Linus is using this feature. When disabled (the default) this should have had no impact on the build time. This feature provides a nice security advantage by significantly reducing the kernel input surface. And people are using that also to better what third party vendor can and cannot do with a distro kernel, etc. But that's not the reason why I implemented this feature in the first place. My primary goal was to efficiently reduce the kernel binary size using LTO even with kernel modules enabled. Each EXPORT_SYMBOL() created a symbol dependency that prevented LTO from optimizing out the related code even though a tiny fraction of those exported symbols were needed. The idea behind the recursion was to catch those cases where disabling an exported symbol within a module would optimize out references to more exported symbols that, in turn, could be disabled and possibly trigger yet more code elimination. There is no way that can be achieved without extra compiler passes in a recursive manner. Nicolas