this post was submitted on 27 May 2025
47 points (81.3% liked)
Linux
54461 readers
735 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Uh, so what's going on here?
This is a compile-time option that will tell the compiler to optimize for the CPU in your computer, rather than any CPU.
By default, the x86_64 kernel will build itself so that it can boot and run on any 64-bit Intel or AMD processor. This means it may have to ignore or check for newer instruction sets like (let’s say, totally at random) AVX512:
So, if you have an AVX512-capable CPU, it still has to check before using that instruction. Plus, your compiled kernel will be slightly larger because it needs to contain both ways of doing the thing.
Using this option tells the compiler to compile code optimized for your current processor:
This is a gross oversimplication. The compiler will also take things into consideration such as instruction sets, scheduling, core and thread counts, big and small cores, and more.
But the tl;dr is that optimized code is smaller, faster, and maybe a teensy bit more power efficient.
The downside? If you try to boot this optimized code on an older CPU (or rarely, a newer CPU), it will eventually say “illegal instruction” and crash.