r/linux • • 21d ago

Kernel ChaCha AVX-512 optimization for Linux 7.5 yields up to 99% improvement on AMD Zen 5

https://www.phoronix.com/news/ChaCha-AVX-512-Linux-7.5
412 Upvotes

30 comments sorted by

61

u/asp174 21d ago

Will this also benefit WireGuard?

55

u/EmptierVoid 21d ago

If you use chacha, then yes technically. However I believe that with amd4/5 the CPU is not the bottleneck so I don't think you will see anything meaningful regarding the perf

34

u/msthe_student 21d ago

Yeah the lowest bar in the graph is almost 3.6 GBps (28.8 Gbps), which unless you're running a lot of clients you're not gonna hit.

19

u/projct 21d ago

using less cpu is still a benefit even if you aren't bottlenecked

6

u/EmptierVoid 21d ago

Absolutely, that's why I added the "regarding the perf". I meant perf as in raw numbers/tput. Of course less CPU could also be translated to better perf in edge cases (load) or something else.

2

u/cake-day-on-feb-29 20d ago

Of course less CPU could also be translated to better perf in edge cases (load) or something else.

Mainly beneficial for power usage for the average consumer.

12

u/Moscato359 21d ago

Wireguard uses kernel chacha, so anything that affects kernel chacha applies

38

u/alex2003super 21d ago

ChaCha real smooth

13

u/perfectdreaming 21d ago

Nice to see Zen4 gets a performance boost of 20-30% as well.

6

u/sob727 21d ago

As a heavy AVX512 consumer.... YEAH !!!!! GREAT NEWS !!!

1

u/LamppostIodine 14d ago

I love AVX512 so much that i'm gonna make an entire game handrolling the x86 assembly.

I love my mask registers. Wish it came with BMI though.

1

u/DeliciousIncident 21d ago

What are your thoughts on Intel's AVX 10.2, which supposedly fixes AVX512's shortcomings?

8

u/oscardssmith 21d ago

It doesn't fix AVX512's biggest shortcoming which is that Intel hasn't shipped it to consumers.

2

u/DeliciousIncident 21d ago

AVX10 (including AVX10.2) is a superset of AVX-512

2

u/oscardssmith 20d ago

right, but that doesn't help the fact that there still isn't a single consumer CPU that supports AVX10

1

u/sob727 20d ago

So that's one thing. And it needs to be used by the math libraries one codes with, unless one wants to do the low level calls themselves.

1

u/sob727 21d ago

No view yet. I'll have one when I see how the new Xeons perform vs my Threadrippers.

5

u/dutch_connection_uk 21d ago

Love to see it.

Maybe eventually DDR5 DIMMs will be cheap enough that I can even begin to consider things newer than Zen 2 or Zen 3.

15

u/ang-p 21d ago

4 ? (Sorry - couldn't resist)

5

u/Irverter 21d ago

What?

12

u/ang-p 21d ago

Just a low-ball bit of humour based on recent news - returning that digit for any input would massively speed up any stream cipher (quite possibly well in excess of 99% - although it would strictly be one-way-only, which might have disadvantages), and as is widely recognised by fair methods, has been proven to be random, and might even be an intrinsically better number than other possibilities....

3

u/0x1f606 21d ago

has been proven to be random

Is this referencing the xkcd?

1

u/ang-p 21d ago

Absolutely ;-)

Along with the "Intrinsically better" reference...

8

u/dr_Fart_Sharting 21d ago

/u/ang-p just leaked the private key

1

u/ang-p 21d ago

I'd never do that - just was wondering if the speed increase was achieved by returning 4 instead of going to the hassle of performing all that pesky math and bit shuffling...

1

u/theanishtar 21d ago

good job

1

u/Filipehdbr 20d ago

The 99% is the ChaCha path in isolation. WireGuard sees a fraction of it because the tunnel isn't cipher-bound end to end

1

u/Maerskian 20d ago

As much as i despise this kind of jokes with weird names... this time is just too much.

Won't make any joke around it, but i'll have you know "Chacha" is an extremely strong alcoholic (45% is the lowests you'll find, homemade versions go around 85% and beyond, not like anybody can hold it & a nice challenge for foreigners) georgian drink.

If anybody is into challenges & in the mood for a trip to Tbilisi or some of those nice sky resorts on those mountains (plenty sky-specific tourism around there), ask for homemade chacha... and be sure to have somebody of your trust around in case something goes wrong.

For the record: i'm not georgian, don't even drink alcohol myself just found this "chacha" to have such a particular name that sticks... now i see it here.

0

u/[deleted] 21d ago

[deleted] — view deleted comment

2

u/Booty_Bumping 21d ago

This is about the kernel, not userspace. Userspace used to be able to access some kernel crypto APIs, but this never got used by anything and so was removed.

This kernel implementation uses the runtime detection you describe, I'm pretty sure. Nobody is actually interested in x86-64-v4 specific kernel builds.