You are not logged in.

#1 2017-11-24 22:06:28

GrimBandito
Member
Registered: 2016-12-04
Posts: 41

[SOLVED] Checksum (crc32c-intel) hardware acceleration

Hi, I am currently running root filesystem on btrfs, raid1 with no partitions. My system has both the linux and linux-lts packages installed.

At boot I notice that BTRFS is utilising the software/generic driver (crc32c-generic) for checksum calculations. I am looking to include support for the checksum hardware accelerated driver (crc32c-intel). In the BTRFS section of the Arch wiki, it is recommended to have this built into the kernel as I am using root on BTRFS.

Looking at both the linux and linux-lts packages it is apparent the kernel comes down prebuilt along with additional modules and mkinitcpio preset.

(Q1) Is there anything I can do to keep using these packages or am I going to have to build my own kernel or use another kernel package (linux-zen?).

(Q2) How much of a speedup would using harware accelerated checksums provide?

(Q3) Does the linux-zen package include support for hardware checksums builtin?

Thanks.

Last edited by GrimBandito (2017-11-25 00:06:51)

Offline

#2 2017-11-24 22:44:57

loqs
Member
Registered: 2014-03-06
Posts: 17,315

Re: [SOLVED] Checksum (crc32c-intel) hardware acceleration

GrimBandito wrote:

(Q1) Is there anything I can do to keep using these packages or am I going to have to build my own kernel or use another kernel package (linux-zen?).

Try adding crc32c_intel to the mkinitcpio along with blacklisting crc32_generic

GrimBandito wrote:

(Q3) Does the linux-zen package include support for hardware checksums builtin?

No
Edit:
Looking at my initrd both versions are included

$ bsdcpio -it  < /boot/initramfs-linux.img | grep crc

So if it is the same on your system you would want to prevent crc32_generic from being selected or remove it from the initrd.
Edit2:
A dirtier solution would be to alter /usr/lib/initcpio/functions line 423.

Last edited by loqs (2017-11-24 23:05:17)

Offline

#3 2017-11-25 00:06:14

GrimBandito
Member
Registered: 2016-12-04
Posts: 41

Re: [SOLVED] Checksum (crc32c-intel) hardware acceleration

Hi @loqs, using 'bsdcpio' on the initramfs revealed that both the generic and intel checksum driver is present.

So I then added the following to the kernel commandline in grub:-

modprobe.blacklist=crc32c_generic

This prevented loading the generic driver, unfortunately this also prevented BTRFS from loading and the system from booting which was a bit of a mystery. No problem, a simple reboot and I am back up again. Strange BTRFS didn't pickup and use crc32c-intel.

* Solution *
=======

Digging a little deeper it turns out my processor supports only SSE4.1 and not SSE4.2 instruction set, which is where hardware acceleration for CRC32 operations is performed. Problem solved.

Looks to me that 'libcrc32c.ko' does the check on hardware availability and pulls in the appropriate driver (crc32c-intel.ko or crc32c_generic) falling back to the generic/software driver.

----------------

Thanks to @loqs for assistance in resolving this.

Last edited by GrimBandito (2017-11-25 19:35:17)

Offline

Board footer

Powered by FluxBB