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

"...The name of the song is called 'Haddocks' Eyes'!"
"Oh, that's the name of the song, is it?" Alice said, trying to
feel interested.
"No, you don't understand," the Knight said, looking a little
vexed. "That's what the name is called. The name really is, 'The Aged
Aged Man.'"
"Then I ought to have said "That's what the song is called'?"
Alice corrected herself.
"No, you oughtn't: that's quite another thing! The song is
called 'Ways and Means': but that's only what it is called you know!"
"Well, what is the song then?" said Alice, who was by this
time completely bewildered.
"I was coming to that," the Knight said. "The song really is
"A-sitting on a Gate": and the tune's my own invention."
-- Lewis Carroll, "Through the Looking Glass"