All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Daniel Gomez <da.gomez@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	John Ogness <john.ogness@linutronix.de>,
	Thomas Gleixner <tglx@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Yury Norov <ynorov@nvidia.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Ao Sun <ao.sun@transsion.com>, David Carlier <devnexen@gmail.com>,
	Karl Mehltretter <kmehltretter@gmail.com>,
	Martin Kaiser <martin@kaiser.cx>,
	Pengpeng Hou <pengpeng@iscas.ac.cn>,
	Qian-Yu Lin <tiffany019230@gmail.com>,
	Rik van Riel <riel@surriel.com>, Rosen Penev <rosenp@gmail.com>,
	Shuvam Pandey <shuvampandey1@gmail.com>,
	Vineeth Pillai <vineeth@bitbyteword.org>,
	Yash Suthar <yashsuthar983@gmail.com>,
	Yu Peng <pengyu@kylinos.cn>
Subject: Re: [GIT PULL] tracing: Updates for 7.2
Date: Mon, 22 Jun 2026 14:50:24 +0200	[thread overview]
Message-ID: <01b656a3-dcd7-48c7-96f0-e174cd2a2c48@suse.com> (raw)
In-Reply-To: <CAHk-=wh3GETAeRS1X=6ThE_3FndKHuhejDcNndzG1ov=fbYPQQ@mail.gmail.com>

On 6/20/26 12:28 AM, Linus Torvalds wrote:
> On Fri, 19 Jun 2026 at 12:07, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> Now, we're not exactly doing great in this area, I'm afraid. To pick a
>> random small core kernel file, we have this kind of disgusting
>> situation:
> 
> Actually, we have much worse cases.
> 
> Doing a "make allmodconfig" will do all those '*.mod.c" files, which
> are tiny generated files that just have some mod-info structure etc
> for linking into the module.
> 
> They're like ten lines of code. MODULE_INFO() and a 'struct module'
> that gets linked in with the actual code. Auto-generated by
> scropts/mod/modpost.c.
> 
> And then they have
> 
>    #include <linux/module.h>
>    #include <linux/export-internal.h>
>    #include <linux/compiler.h>
> 
> and those three lines of include make them balloon into 3MB of code,
> so building those *tiny* things takes forever.
> 
> (Where "forever" is obviously relative - but it's disgustingly long
> for something that should be instant).
> 
> In fact, just a single
> 
>   #include <linux/module.h>
> 
> and absolutely nothing else, will give you 2.8MB of output.
> 
> (In contrast, the two other headers we include - export-internal.h and
> compiler.h - result in 13kB of output. Yesh, it's 550 lines of pretty
> random stuff, but it's not really all that bad. It's mostly just
> really core type declarations, so it's all quite understandable)
> 
> That module.h header situation is beyond disgusting - and yes, it's
> very much noticeable in my build time. Adding some module maintainer
> people, because this is bad, and I think it needs to be fixed.

If I modify scripts/mod/modpost.c and comment out the logic in
write_mod_c_file() so that it produces empty .mod.c files, I see that an
allmodconfig build completes about 5% faster, so I agree that this
contributes non-trivially to the build time.

It should be possible to split the module.h header to avoid this
indirect bloat in .mod.c files. Many members of the module struct are
pointers, so it is sufficient to forward-declare their types. I expect
the problem will be mostly with structures embedded in the module
struct, such as kobject or latch_tree_node, where including their header
files pulls in many others. I'll take a look at how to address this.

-- 
Thanks,
Petr

  reply	other threads:[~2026-06-22 12:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 22:01 [GIT PULL] tracing: Updates for 7.2 Steven Rostedt
2026-06-19  4:23 ` Linus Torvalds
2026-06-19 12:15   ` Steven Rostedt
2026-06-19 14:35     ` Linus Torvalds
2026-06-19 15:40       ` Sebastian Andrzej Siewior
2026-06-19 15:43         ` Linus Torvalds
2026-06-19 18:30           ` Sebastian Andrzej Siewior
2026-06-19 19:07             ` Linus Torvalds
2026-06-19 20:28               ` Thomas Gleixner
2026-06-19 20:55                 ` Linus Torvalds
2026-06-20  9:22                   ` Willy Tarreau
2026-06-19 22:28               ` Linus Torvalds
2026-06-22 12:50                 ` Petr Pavlu [this message]
2026-06-19 15:54       ` Steven Rostedt
2026-06-19 16:29         ` Linus Torvalds
2026-06-21 20:26         ` Agatha Isabelle Moreira
2026-06-21 20:51           ` Linus Torvalds
2026-06-21 21:19             ` Steven Rostedt
2026-06-21 23:16               ` Linus Torvalds
2026-06-22  8:51                 ` Steven Rostedt
2026-06-20 20:24       ` Julia Lawall
2026-06-21 20:34         ` Agatha Isabelle Moreira
2026-06-20 22:19       ` Steven Rostedt
2026-06-20 22:39         ` Linus Torvalds
2026-06-20 23:43           ` Steven Rostedt
2026-06-21  0:18             ` Linus Torvalds
2026-06-21  6:34               ` Steven Rostedt
2026-06-21  7:10               ` Steven Rostedt
2026-06-22  8:40             ` Peter Zijlstra
2026-06-22  8:55               ` Steven Rostedt
2026-06-19 15:19   ` Yury Norov
2026-06-19 15:40     ` Linus Torvalds
2026-06-19 22:18       ` Yury Norov
2026-06-19  4:38 ` pr-tracker-bot

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=01b656a3-dcd7-48c7-96f0-e174cd2a2c48@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=ao.sun@transsion.com \
    --cc=bigeasy@linutronix.de \
    --cc=da.gomez@kernel.org \
    --cc=devnexen@gmail.com \
    --cc=john.ogness@linutronix.de \
    --cc=kmehltretter@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@kaiser.cx \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=pengpeng@iscas.ac.cn \
    --cc=pengyu@kylinos.cn \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=rosenp@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=shuvampandey1@gmail.com \
    --cc=tglx@kernel.org \
    --cc=tiffany019230@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vineeth@bitbyteword.org \
    --cc=yashsuthar983@gmail.com \
    --cc=ynorov@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.