Tuesday, December 30

Linux 6.19 Kernel Benchmarks With X86_NATIVE_CPU Optimization


LINUX KERNEL

Added to the Linux kernel earlier this year was the new X86_NATIVE_CPU Kconfig option to enable compiler optimizations for the local/native CPU in use when building the Linux kernel. In effect about ensuring that the “-march=native” compiler flag is set for the kernel build for optimizing the Linux kernel build for your processor being used. Back with Linux 6.16 I ran some benchmarks of the Linux kernel build with X86_NATIVE_CPU to gauge the impact. Now with the current Linux 6.19 kernel and some different hardware, here are some additional on/off benchmarks for evaluating the impact of the Linux kernel build with X86_NATIVE_CPU.

For this quick round of benchmarking was Linux 6.19 Git built using the GCC 15.2 kernel on Ubuntu 26.04 development.

CONFIG_X86_NATIVE option

This testing was on an AMD Ryzen Threadripper PRO 9995WX 96-core workstation.

Linux 6.19 X86_NATIVE_CPU Built Kernel Benchmarks

The same kernel configuration/build was carried out besides one with the X86_NATIVE_CPU option enabled and the other without.

LevelDB benchmark with settings of Benchmark: Random Read. X86_NATIVE_CPU Build was the fastest.

FS-Mark benchmark with settings of Test: 4000 Files, 32 Sub Dirs, 1MB Size. X86_NATIVE_CPU Build was the fastest.

Flexible IO Tester benchmark with settings of Type: Random Read, Engine: IO_uring, Direct: No, Block Size: 4KB, Job Count: 32, Disk Target: Default Test Directory. X86_NATIVE_CPU Build was the fastest.

In some of the I/O benchmarks there were slight performance benefits from the X86_NATIVE_CPU kernel.

Stress-NG benchmark with settings of Test: Socket Activity. X86_NATIVE_CPU Build was the fastest.

And in synthetic kernel micro-benchmarks.

Memcached benchmark with settings of Set To Get Ratio: 1:100. X86_NATIVE_CPU Build was the fastest.

Cryptsetup benchmark with settings of Twofish-XTS 256b Encryption. X86_NATIVE_CPU Build was the fastest.

Cryptsetup benchmark with settings of Twofish-XTS 512b Decryption. X86_NATIVE_CPU Build was the fastest.

DaCapo Benchmark benchmark with settings of Java Test: Eclipse. Stock Kernel was the fastest.

Memcached benchmark with settings of Set To Get Ratio: 1:5. X86_NATIVE_CPU Build was the fastest.

PostgreSQL benchmark with settings of Scaling Factor: 100, Clients: 1000, Mode: Read Only. X86_NATIVE_CPU Build was the fastest.

ClickHouse benchmark with settings of 100M Rows Hits Dataset, First Run / Cold Cache. Stock Kernel was the fastest.

RocksDB benchmark with settings of Test: Read While Writing. X86_NATIVE_CPU Build was the fastest.

But among the real-world workloads there was minimal benefit overall for this GCC 15 + Linux 6.19 X86_NATIVE_CPU kernel on the AMD Ryzen Threadripper PRO 9995WX Zen 5 workstation.

Apache Cassandra benchmark with settings of Test: Writes. Stock Kernel was the fastest.

Pogocache benchmark with settings of Set To Get Ratio: 1:10. X86_NATIVE_CPU Build was the fastest.

nginx benchmark with settings of Connections: 500. X86_NATIVE_CPU Build was the fastest.

Just a quick article out of this round as after 100+ benchmarks, only in a handful of cases were there any improvements worth noting and just within those synthetic I/O and kernel micro-benchmark tests.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *