Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
EXT4 Ready With Some New Optimizations - Orphan_File, Moving Discard's Work
With EXT4 there are various fixes and improvements as usual but this cycle does bring some new performance work too.
First up, EXT4 adds a new "orphan_file" mount option to speed-up its handling of orphan file handling. As summed up by Jan Kara with the orphan file improvement patch series, "Orphan inode handling in ext4 is a bottleneck for workloads which heavily excercise truncate / unlink of small files as they contend on global s_orphan_mutex (when you have fast enough storage). This patch set implements new way of handling orphan inodes - instead of using a linked list, we store inode numbers of orphaned inodes in a file which is possible to implement in a more scalable manner than linked list manipulations."
This new orphan_file feature should eliminate bottlenecks in such cases of large parallel truncates and file deletions. With a micro-benchmark truncating files byte-by-byte in parallel, with many threads it could mean dropping from a 206 second run-time down to 122 seconds in the peak scenario tested. But even in a single thread scenario it meant a drop from 1.057 seconds to 0.945 seconds and the wins scaled up with the level of parallelism.
Another significant optimization with Linux 5.15 for EXT4 is moving the DISCARD work out of the JBD2 commit thread when having the "discard" mount option enabled. This should help out with devices having slow DISCARD behavior and not blocking the JBD2 commit KThread.
More details on all of the EXT4 improvements for Linux 5.15 via this pull request.