The driver crc32c-intel match CPUs supporting X86_FEATURE_XMM4_2.
On platforms with Zhaoxin CPUs supporting this X86 feature, when
crc32c-intel and crc32c-generic are both registered, system will use
crc32c-intel because its .cra_priority is greater than crc32c-generic.
When doing lmbench3 Create and Delete file test on partitions with
ext4 enabling metadata checksum, found using crc32c-generic driver could
get about 20% performance gain than using the driver crc32c-intel on
some Zhaoxin CPUs. Lower-level testing result is that with the same
input value the generic C implementation takes fewer time than the
crc32c instruction implementation on these CPUs. This case expect to use
crc32c-generic driver for these CPUs to get performance gain.
The presence of crc32c is enumerated by CPUID.01:ECX[SSE4.2] = 1, and
these CPUs other SSE4.2 instructions is ok.
Add a synthetic flag to indicates low performance CRC32C instruction
implementation, set this flag in Zhaoxin CPUs specific init phase, and
exclude CPUs which setting this flag from the driver crc32c-intel.
LeoLiu-oc (3):
ck: x86/cpufeatures: Add low performance CRC32C instruction CPU
feature
ck: x86/cpu: Set low performance CRC32C flag on some Zhaoxin CPUs
ck: crypto: x86/crc32c-intel Exclude low performance CRC32C
instruction CPUs
arch/x86/crypto/crc32c-intel_glue.c | 5 +++++
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/kernel/cpu/centaur.c | 7 +++++++
arch/x86/kernel/cpu/cpuid-deps.c | 1 +
arch/x86/kernel/cpu/zhaoxin.c | 7 +++++++
5 files changed, 21 insertions(+)
--
2.20.1
显示某日回复