Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pdlan
Copy link

@pdlan pdlan commented Oct 2, 2023

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.

@tytso
Copy link
Owner

tytso commented Apr 18, 2024

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
@@ -154,6 +156,8 @@ SRCS= ext2_err.c \
$(srcdir)/closefs.c \
$(srcdir)/crc16.c \
$(srcdir)/crc32c.c \
$(srcdir)/crc32c_intel.c \
$(srcdir)/crc32c_intel_pcl.S \
Copy link
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