News: 0001465242

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux 6.10 Improves Performance For Opening Unencrypted Files

([Linux Storage] 3 Hours Ago FSCRYPT)


[1]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:

"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 [2]this pull request for the ongoing Linux 6.10 merge window.



[1] https://www.phoronix.com/search/FSCRYPT

[2] https://lore.kernel.org/lkml/20240514165532.GA2965@sol.localdomain/



xAlt7x

User42

mb_q

(at this point the lecture turns into why APIs exist and should be used,
and it gets more boring from there...)

- Jeff Garzik explaining the PCI API on linux-kernel