What are differences between linux kernel compiled for generic x86/64 vs Xeon or others -
in linux kernel config there option change cpu family, precompiled kernels generic x86/64
.
i have xeon e3 cpu wondering happen if pick core duo/newer xeon
there.
what differences here? there point in compiling kernel cpu family, instead of generic one? kernel optimized xeon work on non-xeon cpu's? did ever measured differences in performance , on?
it select corresponding config option (from arch/x86/kconfig.cpu):
config mcore2 bool "core 2/newer xeon"
generally speaking, config_mcore2
enable compiler option -mtune=core2
on 32-bit builds , -march=core2
(it can found in makefiles arch/x86/makefile
, arch/x86/makefile_32.cpu
).
these options described in gcc manual page:
-march=cpu-type
generate instructions machine type cpu-type. in contrast -mtune=cpu-type, merely tunes generated code specified cpu-type, -march=cpu-type allows gcc generate code may not run @ on processors other 1 indicated.
specifying -march=cpu-type implies -mtune=cpu-type.
core2
intel core 2 cpu 64-bit extensions, mmx, sse, sse2, sse3 , ssse3 instruction set support.
speaking on overall effect of compile option application performance, should relatively low:
- in kernel overall architecture matters. i.e. contending lock may kill performance , lock-free data-structure gain it. , work regardless of compiler options.
- there small number operations in kernel require simd operations enabled optimization (except copying arrays or strings probably). there small number of cpu-intensive operations in kernel @ all. optimizations cacheline size may work well.
- for applications not kernel-bound spend of time in userspace, calling kernel using system calls effect of optimization reduced proportionally. i.e. 2% kernel performance improvement app spends 10% in kernel, you'll 0.2% overall performance increase.