Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9521rwd; Mon, 15 May 2023 19:03:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Y13kLJG0gZNqcv+GndWcUyXxI46z5VCwSaPAqcHmGTbz0ESQbdJpyHNoSxS6jnphOLStC X-Received: by 2002:a17:903:1110:b0:1ab:74c:bdf2 with SMTP id n16-20020a170903111000b001ab074cbdf2mr48562424plh.28.1684202590782; Mon, 15 May 2023 19:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684202590; cv=none; d=google.com; s=arc-20160816; b=mNWfrKZ6URrH1JoG2y1Zf4HxdyEP6+yi+wsGVQh4Wk8krVi4cv/95KGOfwoqo86D0p faN9zAUNe+XCiCbfPqNJczDE+xvc8KGYwcB5Ut8dm5nfKuKPIJ061neDcdl6VbOmyayF phYiZhagLQsicOJ+LcpxNdnXjzwWB3/C0e8ng1NtcnDT2VXGG9pNJxSdLmojMCpCTswo 7IikbThqRl4AXyQX2DmmUJ3pazqEcvlNxEzmE4pSXdhHAcNsTXH2uODhGB5TJzI3REL8 VUR4kXa/i6mc2R7Xit/uZAfYvr/78cRm6VJvqlSSxnYxNYfYZty7vH8tjsrDFY+IFWr1 IdaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OXsk+CAQVsJj/+1KBRnlzbW8jPhFvHZBA0APqlWB+hc=; b=dWaYhHz1CI4ImNAIdCkzk1b2YWTDzhhRjmUHF2/huXU9Q3pQoHD36VYlzJrhtMEJMX NNv3pIauuUgSrLzhEqqmQ1jtoxxkL1aPbHGfNE8y+EnDdl33AbF6cTw9mAKzpXlrNJjl z0OOcb7Fbp6zO3s1fRjqMTOgUKTn/dSIXeWtslKRNoWbhywINTX6qruz7ZTMdVVtfxWV lUuO75zSTyWBv2exnLVJyhPtmcEj0GNDkNFvQ0C4Jpoa4MQWw9XBC3T5HDspAXbLPG/t o6tVY9v/3DcHb5kalyDCrdY1mBEMHNv8Do+U+cs4cGKIQhf9RpFY7bPOlUy+X7pdNaA8 n1ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H0+yennW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170902c40c00b001ab23cb930bsi19374486plk.417.2023.05.15.19.02.55; Mon, 15 May 2023 19:03:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H0+yennW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjEPBmL (ORCPT + 99 others); Mon, 15 May 2023 21:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbjEPBmJ (ORCPT ); Mon, 15 May 2023 21:42:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 010D155A7; Mon, 15 May 2023 18:42:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 91F3A62137; Tue, 16 May 2023 01:42:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 011F9C4339C; Tue, 16 May 2023 01:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684201328; bh=kYEe3XumnoPUiN8iCq2tISRpzeCXAw5lfoRaIeeBeZw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H0+yennWzqtTXBnuTwnMNwgQ7IERyYqQMcHlLEnaEyGkImfsnnzsXvYLjytObrBwY ysuxOjRgLs2sxJX8tPRmuClLadkLMdvDcC8i5AiO/RnVxfXaD/oBvcZD0viMmKKmjF 3VbC7wj8u5VH+B+6CBnQdjmnwVVLj9MLvzhMOsnOOOxsl+Tul7Vi4fgHT8HDjNw8cK DKdRnt+jyIx3M/QQS3nY5AxJOrXQLm8DyxU5BAbNwtAlWs5pECMT8a5+6qmfPXwzz1 lgK9p1XOK56ueKR6lyelBx3X5b7Qpl6cbj2wHXesC5yZQY/+cjjKPnio0zhqs6CwgQ 5DPkZ4J4Kemgw== Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6ab1a20aa12so5393268a34.1; Mon, 15 May 2023 18:42:07 -0700 (PDT) X-Gm-Message-State: AC+VfDyjTmqd+h+kGeAhkYvSTdfB/mA3TwOI9w5Kr3lFZmFVepS9Zr3Z 8hZdtoBXmdG7oqWGB+79fUA27MXJoLUjfjZOL0Y= X-Received: by 2002:a05:6870:e493:b0:187:d229:2781 with SMTP id v19-20020a056870e49300b00187d2292781mr22671508oag.6.1684201327265; Mon, 15 May 2023 18:42:07 -0700 (PDT) MIME-Version: 1.0 References: <20230514152739.962109-1-masahiroy@kernel.org> <20230514152739.962109-22-masahiroy@kernel.org> In-Reply-To: <20230514152739.962109-22-masahiroy@kernel.org> From: Masahiro Yamada Date: Tue, 16 May 2023 10:41:31 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 21/21] kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Pitre , Nicolas Schier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 12:28=E2=80=AFAM Masahiro Yamada wrote: > > When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses > the directory tree to determine which EXPORT_SYMBOL to trim. If an > EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the > second traverse, where some source files are recompiled with their > EXPORT_SYMBOL() tuned into a no-op. > > Linus stated negative opinions about this slowness in commits: > > - 5cf0fd591f2e ("Kbuild: disable TRIM_UNUSED_KSYMS option") > - a555bdd0c58c ("Kbuild: enable TRIM_UNUSED_KSYMS again, with some guard= ing") > > We can do this better now. The final data structures of EXPORT_SYMBOL > are generated by the modpost stage, so modpost can selectively emit > KSYMTAB entries that are really used by modules. > > Commit 2cce989f8461 ("kbuild: unify two modpost invocations") is another The commit hash is wrong. Commit f73edc8951b2 ("kbuild: unify two modpost invocations") is correct. --=20 Best Regards Masahiro Yamada