Encrypted zfs performance degradation related to kernel version

Asked by Dan Podeanu

root@blink:~# zfs get encryption neo/storage/personal
NAME PROPERTY VALUE SOURCE
neo/storage/personal encryption aes-256-gcm -

Before:

root@blink:~# uname -a
Linux blink 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@blink:~# zfs send neo/storage/personal | pv > /dev/null
61.4GiB 0:01:00 [1.08GiB/s]

After:

root@blink:~# uname -a
Linux blink 5.15.0-37-generic #39-Ubuntu SMP Wed Jun 1 19:16:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@blink:~# zfs send neo/storage/personal | pv > /dev/null
5.61GiB 0:01:00 [96.5MiB/s]

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
Dan Podeanu
Solved:
Last query:
Last reply:
Revision history for this message
Dan Podeanu (pdan) said :
#1

5.15.0-27: 902 MB/s write speed
5.15.0-37: 106 MB/s write speed

root@blink:~# uname -a
Linux blink 5.15.0-37-generic #39-Ubuntu SMP Wed Jun 1 19:16:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@blink:~# cat /dev/zero | pv > /tmp/mount/zero
3.61GiB 0:00:34

root@blink:~# uname -a
Linux blink 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@blink:~# cat /dev/zero | pv > /tmp/mount/zero
3.61GiB 0:00:04

This is the test script:

mkdir /tmp/tmpfs
mkdir /tmp/mount

mount -t tmpfs none /tmp/tmpfs
dd if=/dev/zero of=/tmp/tmpfs/disk1.img bs=1M count=4000
dd if=/dev/zero of=/tmp/tmpfs/disk2.img bs=1M count=4000
zpool create -f \
-O atime=off \
-O compression=off \
-O dedup=off \
-O canmount=off \
-m none \
-o ashift=12 \
test mirror \
/tmp/tmpfs/disk1.img \
/tmp/tmpfs/disk2.img

zfs create -u \
-o mountpoint=/tmp/mount \
-o keylocation=prompt \
-o keyformat=passphrase \
-o encryption=aes-256-gcm \
test/test

zfs mount test/test

Revision history for this message
Dan Podeanu (pdan) said :
#3

Please see the linked bug.

Revision history for this message
Debabrata Banerjee (dbavatar) said :
#4
Revision history for this message
Dan Podeanu (pdan) said :
#5

The updated kernel was released, and it fixes the performance regression. Thank you!

# uname -a
Linux arpa 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

# zfs --version
zfs-2.1.4-0ubuntu0.1
zfs-kmod-2.1.4-0ubuntu0.1

# grep . /sys/module/icp/parameters/*impl*
/sys/module/icp/parameters/icp_aes_impl:cycle [fastest] generic x86_64 aesni
/sys/module/icp/parameters/icp_gcm_impl:cycle [fastest] avx generic pclmulqdq

# dd if=14GBfile.tmp of=/dev/null bs=1M
13411+1 records in
13411+1 records out
14062902185 bytes (14 GB, 13 GiB) copied, 12.6139 s, 1.1 GB/s