Skip to content

lib/ext2fs: port fast crc32c routines for Intel CPUs from kernel. - #161

Open
pdlan wants to merge 1 commit into
tytso:masterfrom
pdlan:master
Open

lib/ext2fs: port fast crc32c routines for Intel CPUs from kernel.#161
pdlan wants to merge 1 commit into
tytso:masterfrom
pdlan:master

Conversation

@pdlan

@pdlan pdlan commented Oct 2, 2023

Copy link
Copy Markdown

This PR ports kernel's fast implementation of crc32c to libext2fs. A simple benchmark by using fio to measure the write throughput of the fuse2fs FUSE 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.

Signed-off-by: pdlan <pengdinglan@gmail.com>
@tytso

tytso commented Apr 18, 2024

Copy link
Copy Markdown
Owner

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

@tytso
tytso self-requested a review April 18, 2024 22:51
Comment thread lib/ext2fs/Makefile.in
$(srcdir)/crc16.c \
$(srcdir)/crc32c.c \
$(srcdir)/crc32c_intel.c \
$(srcdir)/crc32c_intel_pcl.S \

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants