[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linux-module-builder leads to huge store items
From: |
Ludovic Courtès |
Subject: |
Re: linux-module-builder leads to huge store items |
Date: |
Thu, 10 Sep 2020 18:26:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hello,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> On Thu, 10 Sep 2020 10:09:11 +0200
> Ludovic Courtès <ludovic.courtes@inria.fr> wrote:
>
>> Surely we don’t need that much just to build a kernel module. :-)
>
> Since Linux is a monolithic kernel and since C has no modules: Yes, yes we
> do--in the general case.
>
> Linux kernel developers have no interest in supporting out-of-tree modules for
> free (and no interesting in having the Linux kernel API frozen) so there's no
> incentive to support a use case where you can compile a Linux kernel module
> without having the full source of the Linux kernel (that would be just asking
> for license abuse, too).
Understood.
> That would mean that we would have to both design and then support out-of-tree
> build infrastructure ourselves in Guix. And for what? It's only used when
> building the module--it will be thrown away afterwards anyway.
>
> Or is it not garbage-collected afterwards? That would be a serious bug.
It *is* thrown-away afterwards. But until then, it must be deduplicated
(upon build completion, reception, etc.), and that’s a lot of work I/O
wise given the large number of files.
>> ;; TODO: Only preserve the minimum, i.e. [Kbuild], Kconfig,
>> ;; scripts, include, ".config".
>>
>> Which files exactly are needed? Can we go ahead and implement this TODO?
>
> Who knows?
[...]
> Even if we did, there are much worse build-time storage space wastes
> (*cough* llvm *cough*).
But it’s build-time.
> That said, I did a quick size comparison and found those big items:
>
> 150 MB
> a2fs24bgghjvlzq5lzr6zki7mqxx8mpi-linux-libre-module-builder-5.8.7/lib/modules/build/drivers/gpu/drm/amd/include/asic_reg
> 30 MB
> a2fs24bgghjvlzq5lzr6zki7mqxx8mpi-linux-libre-module-builder-5.8.7/lib/modules/build/drivers/staging
>
> I don't think we need these in any potential Linux kernel module--but who
> knows? Maybe somebody does need those.
So, I can think of the following ways to address that:
1. Remove for example *.c, assuming the out-of-tree modules we package
only care about *.h + build machinery.
2. Don’t add all of the Linux source to the store, or at least not
under a new name each time. One way to do that would be to unpack
the Linux-libre tree within the build tree of the out-of-tree
module. We’d be reducing GC stress at the expense of a
(reasonable?) increase in module build time.
Thoughts?
Ludo’.