News: 0001510427

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linus Torvalds Comes Out Against "Completely Broken" x86_64 Feature Levels

([Linux Kernel] 5 Hours Ago No Feature Levels In The Kernel)


With the new Linux kernel patches posted yesterday for [1]cleaning up x86 32-bit kernels on x86_64 CPUs as part of that patch series was introducing new Kconfig build options around the [2]x86_64 micro-architecture feature levels . It turns out though that Torvalds is completely against how the x86_64 feature levels are handled by the compiler toolchain folks and doesn't want to see it invading the kernel.

As a refresher around the x86_64 micro-architecture feature levels, compiler toolchain folks came up with different levels/versions for representing common sets of x86_64 ISA extensions introduced over the years. Over the x86_64 baseline, the x86_64-v2 mandates SSE3/SSE4.2 and other extensions around older AMD Bulldozer and Intel Nehalem CPUs, x86_64-v3 brings AVX/AVX2, BMI2, FMA, and other new extensions from the Intel Haswell and AMD Excavator days, and x86_64-v4 mandates AVX-512 support on top of the v3 extensions.

In response to one of the patches reworking the CPU compiler flags in the x86 Kconfig bits, Linus Torvalds [3]responded :

"The whole "v2", "v3", "v4" etc naming seems to be some crazy glibc artifact and is stupid and needs to die.

It has no relevance to anything. Please do *not* introduce that mind-fart into the kernel sources.

I have no idea who came up with the "microarchitecture levels" garbage, but as far as I can tell, it's entirely unofficial, and it's a completely broken model.

There is a very real model for microarchitectural features, and it's the CPUID bits. Trying to linearize those bits is technically wrong, since these things simply aren't some kind of linear progression.

And worse, it's a "simplification" that literally adds complexity. Now instead of asking "does this CPU support the cmpxchgb16 instruction?", the question instead becomes one of "what the hell does 'v3' mean again?"

So no. We are *NOT* introducing that idiocy in the kernel."

Linus does raise a valid point on the linearization of the feature levels as Intel is currently stuck in an odd position given that their newer laptop/desktop CPUs do not support AVX-512 and then with AVX10 there is both 256-bit and 512-bit options, among other complexities in the handling.

The creator of Linux further [4]added that he's in favor of the reduced complexity of the x86_64 build options with most of the compiler tuning to specific CPUs not really being worthwhile for the kernel. It's likely the Linux kernel will just keep to generic x86_64 and possibly a "-march=native" option for just optimizing for the local system.



[1] https://www.phoronix.com/news/Linux-Cleanup-x86-On-x86_64

[2] https://www.phoronix.com/search/micro-architecture+feature+levels

[3] https://lore.kernel.org/lkml/CAHk-=wh_b8b1qZF8_obMKpF+xfYnPZ6t38F1+5pK-eXNyCdJ7g@mail.gmail.com/

[4] https://lore.kernel.org/lkml/CAHk-=wji1sV93yKbc==Z7OSSHBiDE=LAdG_d5Y-zPBrnSs0k2A@mail.gmail.com/



rene

mxan

mxan

carewolf

davidbepo

avis

patrick1946

patrick1946

ms178

XLVII:
Two-thirds of the Earth's surface is covered with water. The other
third is covered with auditors from headquarters.
XLVIII:
The more time you spend talking about what you have been doing, the
less time you have to spend doing what you have been talking about.
Eventually, you spend more and more time talking about less and less
until finally you spend all your time talking about nothing.
XLIX:
Regulations grow at the same rate as weeds.
L:
The average regulation has a life span one-fifth as long as a
chimpanzee's and one-tenth as long as a human's -- but four times
as long as the official's who created it.
LI:
By the time of the United States Tricentennial, there will be more
government workers than there are workers.
LII:
People working in the private sector should try to save money.
There remains the possibility that it may someday be valuable again.
-- Norman Augustine