Linux 6.10 Improves Performance For Opening Unencrypted Files
FSCRYPT is the file-system encryption framework within the Linux kernel for supporting optional encryption on file-systems like EXT4, F2FS, and others. With Linux 6.10 an optimization is coming for enhancing the performance of opening files on file-systems supporting FSCRYPT-based encryption but when the files are unencrypted.
As a missed optimization until now, a lone new patch is making up the FSCRYPT changes for Linux 6.10. Mateusz Guzik uncovered a rather expensive oversight in handling of unencrypted files on file-systems like EXT4 that support FSCRYPT. He explained in the patch:
Quite a significant boost to the file open performance for these common Linux file-systems supporting FSCRYPT encryption but not necessarily used.
This file open performance optimization for unencrypted files on FSCRYPT-supported file-systems is merged via this pull request for the ongoing Linux 6.10 merge window.
As a missed optimization until now, a lone new patch is making up the FSCRYPT changes for Linux 6.10. Mateusz Guzik uncovered a rather expensive oversight in handling of unencrypted files on file-systems like EXT4 that support FSCRYPT. He explained in the patch:
"fscrypt: try to avoid refing parent dentry in fscrypt_file_open
Merely checking if the directory is encrypted happens for every open when using ext4, at the moment refing and unrefing the parent, costing 2 atomics and serializing opens of different files.
The most common case of encryption not being used can be checked for with RCU instead.
Sample result from open1_processes -t 20 ("Separate file open/close") from will-it-scale on Sapphire Rapids (ops/s):
before: 12539898
after: 25575494 (+103%)"
Quite a significant boost to the file open performance for these common Linux file-systems supporting FSCRYPT encryption but not necessarily used.
This file open performance optimization for unencrypted files on FSCRYPT-supported file-systems is merged via this pull request for the ongoing Linux 6.10 merge window.
5 Comments