Suboptimal glibc performance with amd

Hello,
I want to bring some attention to a AMD problem on Linux.
It seems we don’t get the optimal performance for AMD CPU’s on Linux.
Here is a bug report stating that AMD CPUs are not using all the SIMD stuff in glibc:
https://sourceware.org/bugzilla/show_bug.cgi?id=24979#c1
I don’t know the exact impact of this issue but it would be really nice to get AMD on it.

1 Like

oh shit I don’t know what glibc does but I’m on ryzen and Linux .-.

Zen1 to be specific…

It’s only for compilation of source code. If you don’t do that then this is no way impacts you pretty sure.

1 Like

I’m not too well versed in this but isn’t this just a flag that has to be removed? Which would make it all the more horrible of course.

@Dynamic_Gravity are you thinking of GCC? This is about the GNU C library, not the GNU Compiler Collection.

I wouldn’t worry about this. Yes, just about every program on your system relies on glibc but frankly glibc has never been particularly optimized in the first place. It’s not like this library does any heavy lifting.

iirc intel has lots of developers contributing to glibc so it’s not surprising that it’s more optimized for their processors.

2 Likes

Lol woops I was thinking about gcc xD

What about memcpy? That does impact performance are the avx versions used on amd? Sadly I have no amd cpu to test this. On a 7900x I see them in perf top.

1 Like

So what you’re saying is that performance could be even better on AMD than it is currently under Linux.

This isn’t a surprise, windows is also heavily not-AMD optimised due to heavy use of intel’s compiler…

These sorts of shenanigans are the way intel competes and as above, where AMD need to start focusing their efforts. AMD have a clear lead in CPU design at the moment, performance would be even better if they got software up to scratch as well.

edit:
i’ve tweeted the link at AMDRyzen, will see if they respond

glibc is used by virtually everything on your machine…

Not the case; glibc is used by anything compiled against glibc on your machine. Which means essentially, anything on your linux box written in C, or written in an interpreted language that runs on an interpreter written in C.

Every time you run a program on Linux that is written in C, it is making calls into glibc to do standard “c library” stuff (e.g., strings, math, file IO, etc.).

So… basically everything.

Now, as to the performance impact of this particular issue… that would be everything that makes heavy use of this specific glibc function (it looks like it is SIMD related, so i’m guessing matrix math and similar stuff) that was crippled in the C library.

This would most likely be game performance, media apps, etc.

2 Likes

I will build a new System in the next weeks and will try to modify glibc to use the haswell path and check if this will make a meaningful performance difference. Regardless It would be nice to have some AMD guys working on glibc to get the most out of the CPUs on Linux.