Linux 5.13 To Bring A Huge Speed-Up For MD RAID10 DISCARD Handling
For those running Linux MD RAID10 arrays you may have found the performance around discard requests such as when running MKFS and FSTRIM operations to be rather slow... Well, with Linux 5.13 it will be lightning fast.
For years there have been reports of slow DISCARD handling for RAID10 MD block devices under Linux... There have been bugs file as well over this slow DISCARD performance of MD RAID10 leading to abnormally long MKFS operations and more.
Thanks to Red Hat's Xiao Ni, Linux 5.13 is set to bring a big optimization for the discard request handling for MD RAID10. To the MD RAID10 code, Xiao Ni did a rewrite of the discard request handling code. The improvement is based on MD's earlier RAID0 optimized discard handling that happened back in 2017. The end result is running mkfs.xfs on a MD RAID10 array dropped from taking 4 minutes and 40 seconds to now.... less than 1 second!
This dramatic speed-up from 280 seconds to less than 1 second has now been queued into Linux-block's for-next branch ahead of the Linux 5.13 kernel from md-next. Thus barring any issues from coming up, this optimization will be found in Linux 5.13.