Re: [PATCH 11/23] kbuild: implement and use depcheck to check dependency timestamps
From: Linus Torvalds
Date: Wed Sep 09 2026 - 14:02:49 EST
On Tue, 8 Sept 2026 at 13:57, Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx> wrote:
>
> Each object's .cmd file lists its header dependencies, which often
> consists of over a thousand dependencies.
>
> When little has changed in the tree, this is what make spends most of its
> time doing, spending over a second, single-threaded when parsing larger
> directory trees.
Side note: from some kernel build profiles I did long ago, I have this
memory of it being made much worse by the fact that we use
"$(wildcard xyzzy)"
for all our config header files in those .cmd.o files. That then
causes extra work for 'make' for all of this.
And we do that 'wildcard' thing not because we want to actually match
a pattern, but because that was the only way to have 'make' not
complain about missing config headers.
I'm not even sure the original reason for it is relevant any more -
this is all a very dim memory from years and years ago when I actually
tried to look at profiles of 'make' itself (normally when I do kernel
build profiles I only look at the what the kernel part of the build
is, not user mode).
I just tried removing the 'wildcard' generation from
scripts/basic/fixdep.c and the kernel build didn't care about it at
all. The whole 'wildcard' trick goes all the way back to the original
commit that added that whole 'fixdep.c' phase.
Maybe the whole thing is entirely stale now and should be removed. I
probably just didn't trigger the situation where those extra
'wildcard' things matter. That whole thing is from a quarter century
ago, and nobody has dared look at that code since..
Or maybe 'make' is better at those wildcards these days - or other
things have shifted.
>From those dim memories, make spent a lot of time doing filesystem
lookups (directory reading and 'stat()' calls - the wildcard thing
triggered more getdents calls), but even more time just in string
handling.
Linus