this post was submitted on 04 May 2026
58 points (100.0% liked)

Linux

17408 readers
6 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

Up until the early 2000s I used to compile my own kernel, carefully selecting only the options that I needed.

Then I realised that I wasn't saving memory, because almost everything was a module anyway.

Is there any actual benefit to using a custom kernel on consumer hardware that's supported by the stock kernels?

top 16 comments
sorted by: hot top controversial new old
[–] CameronDev@programming.dev 26 points 5 days ago (1 children)

You could compile with -march=native to get an optimised build, but its unlikely to show any benefit outside benchmarks.

[–] tomiant@piefed.social 11 points 5 days ago* (last edited 5 days ago)

It's a matter of pride, honor, and the classical ideals of antiquity!

[–] Kazumara@discuss.tchncs.de 16 points 5 days ago* (last edited 5 days ago) (3 children)

Primarily if you want some functionality that isn't mainlined, or isn't released as stable yet.

Like hibernate in lockdown mode, or out of tree drivers, or maybe something new coming up in the emulation support world like NTSync, though I think that last example was mainlined by now.

I think that last example was mainlined by now.

Yeah NTSync is in kernel 7.0x

[–] henfredemars@infosec.pub 5 points 5 days ago

Woah, I didn’t know they were working on those features. Thanks for sharing!

[–] frongt@lemmy.zip 0 points 5 days ago (1 children)

Drivers are usually loaded as modules, aren't they?

[–] Kazumara@discuss.tchncs.de 2 points 5 days ago

I'm not that certain to be honest. But the following is my best understanding:

  • Most drivers are included directly in the kernel source.

  • They can be compiled built-in directly to the kernel binary, or they can be compiled as loadable kernel modules. I don't know how the proportions between the two options look, but at least the essential drivers (chipsets, filesystems, etc) should be compiled in to allow the boot to progress enough that module loading works.

  • There are some, like the Nvidia proprietary GPU driver, that are provided only in binary form as loadable kernel modules.

  • I also understand that a lot of smartphone drivers are developed out-of-tree against older branches of the Linux kernel. Even those that are made public / open sourced, end up living outside the mainline kernel, and the devs of third party android builds have to cherry pick them into their kernel source.

I think at least the last group should count as an example of a reason of the type for what OP was looking for.

[–] 7uWqKj@lemmy.world 6 points 5 days ago

Besides for fun you mean? No.

[–] Libb@piefed.social 11 points 5 days ago

Your question is one of the two reasons I love GNU/Linux so much, and will not go back to proprietary tools ever again :)

Even tough as a very average user myself I would never feel like compiling my own kernel, and would even less know how to do such a thing, I know it's a possibility and I know other users are doing it. And that is a possibility only because of the freedoms we the users are given by the GPL to do... what we want. To me, as an ex-lifelong Apple user (I started being their customer in the early 80s and only switched full time some 7 or 8 years ago to GNU/Linux) this is amazing and wonderful freedom.

Sorry if I have not replied precisely to your question but reading it I realized it was a great demonstration of what freedom is supposed to mean, and I felt like sharing it.

[–] onlinepersona@programming.dev 11 points 5 days ago

In all my time with Linux, I have never once recompiled. I'd go as far to say as it is never necessary for a normo to do it.

[–] henfredemars@infosec.pub 10 points 5 days ago* (last edited 5 days ago)

Normal user? Extremely rarely would you need to build the kernel. Distributions design their options to fit most use cases, and you’ve observed the extensibility through modules. The kernel itself has moved towards runtime configurable options for your convenience over time, such as with

PREEMPT_DYNAMIC

Where in the past changing the preemption model would require a recompile. Ultimately, this is a good thing; it makes your life easier and you can get better support for a common kernel if you need to debug.

It does happen though if you need special hardware or if you’re picky about specific kernel features. For example, I’ve used kernels that don’t have built-in support for memory compression. Need is a subjective term, and I felt that was a configuration option that I needed because a memory upgrade was not an option. I would argue there was a point to that effort. Considering that you phrase your question as asking about normal users, then no, I would say that’s rarely beneficial, might actually be disadvantageous because you won’t receive as much help debugging problems from your distribution, and generally you can achieve your goals by tuning runtime kernel parameters anyway.

[–] UndergroundParking@lemmy.cafe 6 points 5 days ago

Actual benefit? I'd say code not compiled in is code that cannot be abused.

There are also more obscure benefits - like getting more familiar with your system.

[–] fruitycoder@sh.itjust.works 5 points 5 days ago

I've only done it to REMOVE features but that's just a silly exercise in making the absolute tiniest OS I can

[–] eksb@programming.dev 5 points 5 days ago

The only time I have compiled a kernel in the last 10 years was to bisect to determine what change introduced a bug affecting my particular hardware combination.

[–] BartyDeCanter@piefed.social 4 points 5 days ago

For consumer hardware supported by stock kernels? No advantage at all. At most you may want to switch kernels, but most distros have a handy tool for that.

The only time I’ve compiled my own kernel in the last 15 years has been for work on very specialized embedded systems.

Not really unless you need a specific optimization or module that isn't available otherwise. Most distros make distribution of external modules available via package manager, and most of the optimizations you would want to enabke can be turns on or off elsewhere as feature flags.