lib/ext2fs: port fast crc32c routines for Intel CPUs from kernel. - #161
lib/ext2fs: port fast crc32c routines for Intel CPUs from kernel.#161pdlan wants to merge 1 commit into
Conversation
Signed-off-by: pdlan <pengdinglan@gmail.com>
|
This patch has significant portability problems. It appears to assume that certain header files like /usr/include/cpuid.h are always present. If you enable github actions, you'll see that your commit breaks quite a number of builds: https://github.com/tytso/e2fsprogs/actions/runs/8745541253 |
| $(srcdir)/crc16.c \ | ||
| $(srcdir)/crc32c.c \ | ||
| $(srcdir)/crc32c_intel.c \ | ||
| $(srcdir)/crc32c_intel_pcl.S \ |
There was a problem hiding this comment.
This assumes that the makefile rules have a .S -> .o rule, and that compilers will accept the .S as a assembly file as input. That's not very portable. There are people who build e2fsprogs on NetBSD, FreeBSD, MacOS, Windows, Android, OpenSolaris, AIX, etc. There seems to be an unfortunate assumption that "all the world's x86" and "all the world's Linux", or "the only compiler is gcc" or "the only compiler is clang".
This PR ports kernel's fast implementation of crc32c to libext2fs. A simple benchmark by using
fioto measure the write throughput of thefuse2fsFUSE driver on an ext4 partition (with 1M block size) shows that the throughput increases from 186 MiB/s to 278 MiB/s with my Micron SSD.