linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	bas@baslab.org, tglozar@gmail.com, Ast-x64@protonmail.com,
	viktor.malik@gmail.com, Daniel Xu <dxu@dxuuu.xyz>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Andi Kleen <ak@linux.intel.com>, Ian Rogers <irogers@google.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	linux-modules <linux-modules@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Eugene Loh <eugene.loh@oracle.com>,
	Kris Van Hees <kris.van.hees@oracle.com>
Subject: Re: [PATCH v8 2/6] kbuild: add modules_thick.builtin
Date: Thu, 10 Feb 2022 12:55:43 +0000	[thread overview]
Message-ID: <8735kqswxc.fsf@esperi.org.uk> (raw)
In-Reply-To: <CAK7LNAToG8ozUcMcro4osBKPiisqW4mpo+=uBeMUmVfztnNMDA@mail.gmail.com> (Masahiro Yamada's message of "Thu, 10 Feb 2022 09:35:45 +0900")

On 10 Feb 2022, Masahiro Yamada told this:

> On Wed, Feb 9, 2022 at 3:44 AM Nick Alcock <nick.alcock@oracle.com> wrote:
>>
>> I am not wedded to the approach used to construct this file, but I don't
>> see any other way to do it despite spending a week or so trying to tie
>> it into Kbuild without using a separate Makefile.modbuiltin: unlike the
>> names of builtin modules (which are also recorded in the source files
>> themseves via MODULE_*() macros) the mapping from object file name to
>> built-in module name is not recorded anywhere but in the makefiles
>> themselves, so we have to at least reparse them with something to
>> indicate the builtin-ness of each module (i.e., tristate.conf) if we are
>> to figure out which modules are built-in and which are not.
>>
>> Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
>> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> modules.builtin was initially implemented in a terrible way,
> hence I cleaned up the code and removed the double recursion
> of the source tree.

That's why I said I was not wedded to this approach, and I'd be happy
to use another one.

I tried to reimplement it using a single recursion, but it seems to be
impossible or at least very difficult, since you have to somehow
interpret each target in the tree in two ways ("build this" versus
"figure out whether this is built-in or not): if you can think up a
trick, I'll give it a try. I tried to make the core Kbuild makefiles
interpret obj-Y suitably, which might mean you could build the whole
tree with tristate.conf in force as it is in Makefile.modbuiltin, but
got lost in the tangle: and in any case doing that seemed far more
invasive and far more likely to be rejected than just bringing back
Makefile.modbuiltin.

But for now, to me, this seems tolerable. The time costs of building
modules_thick.builtin are so minimal I cannot determine them in a normal
parallel build, well down in the noise, unless your machine is so short
of memory that it can't even cache the directory tree walk (and with the
cache hot, even with -j 1 building it takes only half a second). The
maintenance costs appear to be basically zero as well: one file, not
tightly coupled to the rest (the only coupling it has is the same
coupling as every makefile in the build tree). Also one file that was
present for decades already :)

So... honestly, I don't see your objection. What's terrible about
scripts/Makefile.modbuiltin? If it's so terrible, do you have an
alternative way to do what it does in this patch series?

> Honestly, I do not want to see you bringing back
> all the bloat.

It's come back because I find it necessary for the series which follows,
which surely makes it not bloat. If you can think of another approach
that can similarly figure out which modules are built in and which are
not, I'd be happy to use it, but I can't think of one.

  reply	other threads:[~2022-02-10 12:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 18:43 [PATCH v8] kallsyms: new /proc/kallmodsyms with builtin modules Nick Alcock
2022-02-08 18:43 ` [PATCH v8 1/6] kbuild: bring back tristate.conf Nick Alcock
2022-02-08 18:43 ` [PATCH v8 2/6] kbuild: add modules_thick.builtin Nick Alcock
2022-02-10  0:35   ` Masahiro Yamada
2022-02-10 12:55     ` Nick Alcock [this message]
2022-02-08 18:43 ` [PATCH v8 3/6] kbuild: generate an address ranges map at vmlinux link time Nick Alcock
2022-02-08 18:43 ` [PATCH v8 4/6] kallsyms: introduce sections needed to map symbols to built-in modules Nick Alcock
2022-02-10  0:48   ` Masahiro Yamada
2022-02-08 18:43 ` [PATCH v8 5/6] kallsyms: optimize .kallsyms_modules* Nick Alcock
2022-02-08 18:43 ` [PATCH v8 6/6] kallsyms: add /proc/kallmodsyms Nick Alcock
2022-02-11 22:36 ` [PATCH v8] kallsyms: new /proc/kallmodsyms with builtin modules Jiri Olsa
2022-02-14 15:40   ` Nick Alcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735kqswxc.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=Ast-x64@protonmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bas@baslab.org \
    --cc=dxu@dxuuu.xyz \
    --cc=eugene.loh@oracle.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kris.van.hees@oracle.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglozar@gmail.com \
    --cc=viktor.malik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).