On Wed, 4 Dec 2024 at 11:44, Arnd Bergmann <arnd@xxxxxxxx> wrote: > > I guess the other side of it is that the current selection > between pentium4/core2/k8/bonnell/generic is not much better, > given that in practice nobody has any of the > pentium4/core2/k8/bonnell variants any more. Yeah, I think that whole part of the x86 Kconfig is almost entirely historical. It's historical also in the sense that a lot of those decisions matter a whole lot less these days. The whole CPU tuning issue is happily mostly a thing of the past, since all modern CPU's do fairly well, and you don't have the crazy glass jaws of yesteryear with in-order cores and the insane instruction choice sensitivity of the P4 uarch. And on our side, we've just also basically turned to much more dynamic models, with either instruction rewriting or static branches or both. So I suspect: > A more radical solution would be to just drop the entire > menu for 64-bit kernels and always default to "-march=x86_64 > -mtune=generic" and 64 byte L1 cachelines. would actually be perfectly acceptable. The non-generic choices are all entirely historical and not really very interesting. Absolutely nobody sane cares about instruction scheduling for the old P4 cores. In the bad old 32-bit days, we had real code generation issues with basic instruction set, ie the whole "some CPU's are P6-class, but don't actually support the CMOVxx instruction". Those days are gone. And yes, on x86-64, we still have the whole cmpxchg16b issue, which really is a slight annoyance. But the emphasis is on "slight" - we basically have one back for this in the SLAB code, and a couple of dynamic tests for one particular driver (iommu 128-bit IRTE mode). So yeah, the cmpxchg16b thing is annoying, but _realistically_ I don't think we care. And some day we will forget about it, notice that those (few) AMD early 64-bit CPU's can't possibly have been working for the last year or two, and we'll finally just kill that code, but in the meantime the cost of maintaining it is so slight that it's not worth actively going out to kill it. I do think that the *one* option we might have is "optimize for the current CPU" for people who just want to build their own kernel for their own machine. That's a nice easy choice to give people, and '-march=native' is kind of simple to use. Will that work when you cross-compile? No. Do we care? Also no. It's basically a simple "you want to optimize for your own local machine" switch. Maybe that could replace some of the 32-bit choices too? Linus