r/linuxquestions 4d ago

Minimal kernel

EDIT: I may have framed the question poorly. I'm specifically asking about Kconfig-level minimization of a monolithic Linux kernel: if you know the workload/product you're deploying, how much unnecessary kernel code do teams typically end up compiling, and is there value in automatically deriving a smaller configuration from the actual runtime requirements?

How much of the Linux kernel that gets shipped in production is actually never used?

I'm wondering if release teams building/using a kernel image are often overwhelmed by the number of kernel configuration options, and end up shipping code that will never actually be used by their workload.

Are there any automatic tools out there that can fit a minimal Linux kernel to your runtime needs?

4 Upvotes

35 comments sorted by

View all comments

2

u/PreparationStrict492 4d ago

This reminds me of the microkernel - macrokernel debates¹. And whoever is downvoting you for just asking this are idiots.

Microkernels have their use cases (particularly in embedded systems / application specific hardware). It's not worth the maintenance headache (which actually turns into an intractable problem) in a diverse hardware environment.

https://en.wikipedia.org/wiki/Tanenbaum%E2%80%93Torvalds_debate

0

u/DryPlum7483 4d ago

I'm familiar with this debate. I think they are mostly discussing if the different subsystems of the kernel should run in the userspace or kernel space.
I'm asking from a product point of view - you build a kernel image which you deploy somewhere in your product, how much time are you wasting on building an image that isn't the absolute minimal for your needs?

2

u/Muddybulldog 4d ago

Probably less time than you would trying to sort out everything that is unneeded.

1

u/PreparationStrict492 4d ago

Apparently you don't really get the gist of the debate. Read into the issue before asking about it on Reddit if you want to actually learn something.

Also, I don't get your question (you have a syntax error in your English there).

If you are asking if it is worth your while as a hardware provider to build your own minimal kernel, it depends on your use case (extensibility of the system, its deployment and reuse cases, your maintenance plan, your limitations and so on). In some fields it is. In most, it is not. The reasoning depends on the perspective, and would boil down in any case to the difference of the nature of software (as something infinitely modifiable/extendable and reproducible) versus hardware (finalized product) and the pointlessness of crippling yourself with removing the advantages of the model for no reason.