EXT4 Ready With Some New Optimizations - Orphan_File, Moving Discard's Work
It's busy on the Linux file-system front for the 5.15 cycle with Btrfs adding a degenerate RAID option along with performance improvements to big improvements for XFS and now comes the EXT4 updates.
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.
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.
2 Comments