mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Campos Ramos <capitain_jack@yahoo.com>
To: Lorenzo Stoakes <ljs@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/23] kbuild: significantly speed up kernel builds
Date: Sat, 07 Nov 2026 23:36:21 -0300	[thread overview]
Message-ID: <179410538124.1716246.9582944258691673781@yahoo.com> (raw)
In-Reply-To: <179252139906.1666014.10596432029920554734@yahoo.com>

Hi Lorenzo, Linus,

A follow-up to my 20 October note, with controlled numbers.

The principle is the compiler's, applied to comments: prepare once what the machine reads, and keep what people read beside it.
The web already does this: minifiers remove 48 to 70% of JavaScript bytes in one study, and source maps lead back to the original.
Debian does it for binaries: stripped in the package, debug symbols in -dbgsym.
Lean Code does it for the text a system reads: headers, scripts, settings.

Every changed file has three forms:
1. The authored source, unchanged, in the source package.
2. The machine form, installed: comment-only lines removed; blank lines, directives and code untouched.
3. The human form, the complete authored text, in a <package>-lc-hr companion at the same version.
The human form costs nothing at build or run time, so documentation can grow there, better grounded, paid for once by the person who reads it.
Line numbers shift on purpose; a tool finds a machine-form line by its content in the authored source (dpkg-stereo --resolve PATH:LINE).
An earlier form inserted #line directives: it cost about 21% more preprocessing and silently disabled -Wmisleading-indentation. It is gone.

Measured, per file type (instructions with perf):
- Kernel headers, linux-headers 7.3.1, 50.7 to 46.9 MB (-7.5%): preprocessing -0.78%, compiling -0.52%.
- libstdc++, 864 headers (-23.6% bytes): preprocessing -2.7 to -3.0% instructions and -3.9 to -4.3% cycles; -O2 objects byte-identical; one compile of bits/stdc++.h reads 1.9 MB less.

Measured, the whole system: a 2016 AMD A10 laptop, 28,500 installed files lean, then restored to the originals, then lean again:
- DKMS module builds against the kernel headers: 6 to 9% faster warm, 1 to 6% cold. That is more than the instruction counts, which points at reading and caching; the two are not separated yet.
- Programs use 3 to 6% less memory; boot time is unchanged; installed package files take 140 MB less disk.
- The cost: 0.4 to 0.8 s more per dpkg run for the integrity check (about 64 ms in the current version), and a full verification takes 22 s instead of 11.
- Modules built lean are identical to each other; against the original headers, modules whose macros carry header line numbers differ in those numbers only.

Scaled, as estimates rather than measurements; I found no reliable count of Linux machines, so per million, to multiply by any fleet:
- A developer building 1 hour a day against kernel headers saves 15 to 22 hours a year; per million such machines, 15 to 22 million hours.
- Per million machines: 140 TB less disk, and 3.8 TB less page cache where the kernel headers are kept.
- A desktop user who never compiles comes out about even.

For scale: GCC 16 builds the kernel about 2.6% slower than GCC 15 in one report; Ingo Molnar's first header attempts gave barely 4% before Fast Kernel Headers reached 50 to 80% with over 2,000 commits; your series reports allmodconfig up to 36% faster.
This stacks with all of them, with no source change.

I am not proposing anything for the kernel tree.
If a defconfig or allmodconfig comparison on the kernel's own include/, with the objects checked, would be useful, I can run it.
Methods and raw data:
https://github.com/Sparky-OS/sparky-stereo-os/blob/main/docs/proofs/lean-code-a10-aba.md
https://github.com/Sparky-OS/sparky-stereo-os/blob/main/docs/proofs/lean-code-compile-cycles.md

Daniel Campos Ramos

  reply	other threads:[~2026-11-08  2:36 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 20:55 Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 01/23] scripts/mksysmap: drop the MODULE_INFO() symbols from kallsyms Lorenzo Stoakes (ARM)
2026-09-09 19:47   ` Nicolas Schier
2026-09-10 11:00     ` Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-10 11:03     ` Lorenzo Stoakes (ARM)
2026-09-10 19:00   ` Nicolas Schier
2026-09-08 20:55 ` [PATCH 02/23] scripts/mksysmap: fix escape of '$' in the __pi_ pattern Lorenzo Stoakes (ARM)
2026-09-09 19:47   ` Nicolas Schier
2026-09-10 11:04     ` Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-10 11:21     ` Lorenzo Stoakes (ARM)
2026-09-10 19:00   ` Nicolas Schier
2026-09-08 20:55 ` [PATCH 03/23] kallsyms: index symbols by token to speed up table compression Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 04/23] kallsyms: output binary data to speed output and kallsyms assembly Lorenzo Stoakes (ARM)
2026-09-09 14:35   ` Linus Torvalds
2026-09-14  8:39     ` Lorenzo Stoakes (ARM)
2026-09-14  8:57       ` Lorenzo Stoakes (ARM)
2026-09-10  9:29   ` David Laight
2026-09-11 11:07     ` Lorenzo Stoakes (ARM)
2026-09-12  6:38     ` [4/23] " Markus Elfring
2026-09-08 20:55 ` [PATCH 05/23] kbuild: do not sort nm output where the order is irrelevant Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-08 20:55 ` [PATCH 06/23] kbuild: only emit vmlinux relocations when required Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-13 19:33     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 07/23] elf-parse: add section flags, symbol binding and a read-only mapping Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 08/23] kallsyms: reimplement mksysmap in C Lorenzo Stoakes (ARM)
2026-09-11 18:52   ` Markus Elfring
2026-09-11 19:15   ` Markus Elfring
2026-09-11 19:42   ` Markus Elfring
2026-09-08 20:55 ` [PATCH 09/23] kbuild: do not allocate .modinfo in vmlinux Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-10 10:59     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 10/23] kbuild: cache list, composite object state per object Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 11/23] kbuild: implement and use depcheck to check dependency timestamps Lorenzo Stoakes (ARM)
2026-09-09 15:26   ` Linus Torvalds
2026-09-14  8:28     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 12/23] kbuild: avoid re-running compiler and linker probes Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-10 15:42     ` Nicolas Schier
2026-09-11 10:30       ` Lorenzo Stoakes (ARM)
2026-09-11 18:10         ` Nicolas Schier
2026-09-11 18:25           ` Lorenzo Stoakes (ARM)
2026-09-11 17:33       ` David Laight
2026-09-11 18:17         ` Nicolas Schier
2026-09-11 18:24           ` Lorenzo Stoakes (ARM)
2026-09-11 19:34             ` Nicolas Schier
2026-09-11 21:01             ` David Laight
2026-09-12  7:11             ` Nathan Chancellor
2026-09-13 20:02               ` Lorenzo Stoakes (ARM)
2026-09-11 10:26     ` Lorenzo Stoakes (ARM)
2026-09-12  6:51       ` Nathan Chancellor
2026-09-12 10:03     ` David Laight
2026-09-08 20:55 ` [PATCH 13/23] modpost: hash module source per-file, not per-byte Lorenzo Stoakes (ARM)
2026-09-10 12:52   ` Petr Pavlu
2026-09-11 10:41     ` Lorenzo Stoakes (ARM)
2026-09-11 11:57       ` Petr Pavlu
2026-09-11 12:21         ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 14/23] modpost: cache section relocation mismatch state Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 15/23] modpost: emit module descriptors as assembly Lorenzo Stoakes (ARM)
2026-09-09 14:59   ` Linus Torvalds
2026-09-14  8:50     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 16/23] kbuild: batch module finalisation Lorenzo Stoakes (ARM)
2026-09-10 15:48   ` Nicolas Schier
2026-09-11 10:23     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 17/23] modpost: perform srcversion hashing in parallel Lorenzo Stoakes (ARM)
2026-09-10 10:32   ` David Laight
2026-09-11 10:49     ` Lorenzo Stoakes (ARM)
2026-09-12 11:50   ` Yann Droneaud
2026-09-13 16:36     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 18/23] objtool: cache relocations and function dead end state, do less work Lorenzo Stoakes (ARM)
2026-09-12 22:47   ` Josh Poimboeuf
2026-09-13 20:28     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 19/23] objtool: decode instructions and resolve branch targets in parallel Lorenzo Stoakes (ARM)
2026-09-12 23:39   ` Josh Poimboeuf
2026-09-13 16:23     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 20/23] kbuild: rust: parallelise rustc front end Lorenzo Stoakes (ARM)
2026-09-08 21:13   ` Miguel Ojeda
2026-09-09 14:22     ` Lorenzo Stoakes (ARM)
2026-09-09 10:22   ` Björn Baron
2026-09-09 12:59     ` Miguel Ojeda
2026-09-09 14:26       ` Lorenzo Stoakes (ARM)
2026-09-10 12:25     ` Nicolas Schier (FRITZ!)
2026-09-11 19:00   ` Nicolas Schier
2026-09-13 21:30     ` Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 21/23] rust: make exports.o depend on the headers generated for it Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 22/23] kbuild: build rust crates in parallel with the rest of the build Lorenzo Stoakes (ARM)
2026-09-08 20:55 ` [PATCH 23/23] kbuild: use pigz for gzip compression if available Lorenzo Stoakes (ARM)
2026-09-10  4:19   ` Nathan Chancellor
2026-09-11 11:03     ` Lorenzo Stoakes (ARM)
2026-09-12  6:38       ` Nathan Chancellor
2026-09-13 19:31         ` Lorenzo Stoakes (ARM)
2026-09-08 21:06 ` [PATCH 00/23] kbuild: significantly speed up kernel builds Nick Desaulniers
2026-09-09 14:17   ` Lorenzo Stoakes (ARM)
2026-09-09 22:09     ` Nick Desaulniers
2026-09-11 11:25       ` Lorenzo Stoakes (ARM)
2026-09-09 15:37 ` Linus Torvalds
2026-09-09 16:30   ` Lorenzo Stoakes (ARM)
2026-10-20 18:36   ` Daniel Campos Ramos
2026-11-08  2:36     ` Daniel Campos Ramos [this message]
2026-09-09 21:58 ` Florian Fainelli
2026-09-11 11:28   ` Lorenzo Stoakes (ARM)
2026-09-12  6:44     ` Nathan Chancellor
2026-09-13 16:27       ` Lorenzo Stoakes (ARM)
2026-09-10  4:19 ` Nathan Chancellor
2026-09-11 11:13   ` Lorenzo Stoakes (ARM)

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=179410538124.1716246.9582944258691673781@yahoo.com \
    --to=capitain_jack@yahoo.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®