Re: [PATCH 0000/2297] [ANNOUNCE, RFC] "Fast Kernel Headers" Tree -v1: Eliminate the Linux kernel's "Dependency Hell"

From: Andy Shevchenko
Date: Tue Jan 04 2022 - 11:19:37 EST


On Sun, Jan 02, 2022 at 10:57:35PM +0100, Ingo Molnar wrote:
>
> I'm pleased to announce the first public version of my new "Fast Kernel
> Headers" project that I've been working on since late 2020, which is a
> comprehensive rework of the Linux kernel's header hierarchy & header
> dependencies, with the dual goals of:
>
> - speeding up the kernel build (both absolute and incremental build times)
>
> - decoupling subsystem type & API definitions from each other
>
> The fast-headers tree consists of over 25 sub-trees internally, spanning
> over 2,200 commits, which can be found here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git master
>
> As most kernel developers know, there's around ~10,000 main .h headers in
> the Linux kernel, in the include/ and arch/*/include/ hierarchies. Over the
> last 30+ years they have grown into a complicated & painful set of
> cross-dependencies we are affectionately calling 'Dependency Hell'.

$ git grep -n -w kernel.h mingo/sched/headers -- include/ | wc -l
138
$ git grep -n -w kernel.h next/master -- include/ | wc -l
96

Can we rather split kernel.h more? In some cases kernel.h is used just as a
bundle instead of ~2-3 headers.


And I can't get why kernel.h is returned in the drm headers. AFAICT there are no
dependencies:

mingo/sched/headers:include/drm/drm_gem_ttm_helper.h:6:#include <linux/kernel.h>
mingo/sched/headers:include/drm/drm_gem_vram_helper.h:15:#include <linux/kernel.h> /* for container_of() */
mingo/sched/headers:include/drm/drm_mm.h:44:#include <linux/kernel.h>
mingo/sched/headers:include/drm/drm_property.h:28:#include <linux/kernel.h>
mingo/sched/headers:include/drm/intel-gtt.h:9:#include <linux/kernel.h>

Ah, it may be due to base on the vanilla rather than on next, it would be
nice to see this rebased on top of v5.17-rc1 when it's out.


--
With Best Regards,
Andy Shevchenko