You are not logged in.

#1 2022-05-01 07:44:42

thehexagon
Member
From: New Zealand
Registered: 2020-10-26
Posts: 62
Website

[DISCUSSION] is it worth it to manually build the Linux Kernel

I just wanted to know if it was worth it to manually build the Linux Kernel. I wanted to build it with

-MARCH=NATIVE

or whatever it is. This is for a midrange Intel CPU for a laptop. I forgot the exact specs so I will add it later. I want to do this with the main aim to save battery life. Is there any options that you guys recommend, or is it just not worth it?


I swear, can someone make a working, budget Linux laptop, instead of everything being high end.

Offline

#2 2022-05-01 07:54:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,065
Website

Re: [DISCUSSION] is it worth it to manually build the Linux Kernel

It depends what you want out of it. I have been building my own kernel since 3.10.5, so yeah, I think it is worth it.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2022-05-01 12:32:08

loqs
Member
Registered: 2014-03-06
Posts: 14,919

Re: [DISCUSSION] is it worth it to manually build the Linux Kernel

With respect to building the kernel with custom CFLAGS have you read https://bbs.archlinux.org/viewtopic.php?id=270652

Offline

#4 2022-05-01 12:51:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 26,900
Website

Re: [DISCUSSION] is it worth it to manually build the Linux Kernel

thehexagon wrote:

I want to do this with the main aim to save battery life.

No, no, and definitely no.  What makes you think that a build flag on the kernel would have any effect at all on battery life??

I highly doubt any generic compiler optimizations used for building the kernel could have any detectable improvement for battery life.  I'd also very happily wager that any amount of power saved during the running of said kernel would be a drop in the bucket compared to the power used for rebuilding the kernel for every update.

And why even target the kernel for this?  What's using the most battery power on your system?  I doubt it's the kernel.  I'd also doubt you'd have a whole lot of benefit in battery life from adjusting general compiler flags for userspace programs - but they'd probably be better targets than the kernel (first candidates I'd check power usage of would be web browsers [the actual rendering engines that is], or audio/video software depending on your usage patterns).  And these user space programs are generally much much easier to rebuild than a kernel.

So I strongly doubt there's any point in adjusting generic compiler flags with the intent of improving battery life, but even if there is, I'm pretty sure the kernel would the one of the highest (if not highest) cost-to-benefit ratios (highest = bad, lots of cost, for little to no benefit).

Compiling a kernel can provide other benefits - perhaps the most potent one is the learning opportunities - but if you're goal is battery performance look elsewhere, and test first.  Use powertop or some related monitoring tools to see where your battery power is actually going.

Caveate: many of these points are my "doubts" or what I'd "bet" on.  I don't have empirical data to support these suspicions of lack of benefit.  But if you don't have some reason to think that adding such a flag for a kernel build will help, then it's pretty silly to go through with it.  The idea goes in the same category as Bertrand Russel's orbiting teapot - until there is at least some reason to take the idea seriously, it is fair to see it as absurdly unlikely.

Last edited by Trilby (2022-05-01 12:57:22)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB