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?

  • CameronDev@programming.dev
    link
    fedilink
    English
    arrow-up
    19
    ·
    21 days ago

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

  • Kazumara@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    20 days ago

    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.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    7
    ·
    21 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.

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    21 days ago

    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.

  • henfredemars@infosec.pub
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    20 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.

  • eksb@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    20 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.