On 19/07/17 11:02, Lennert Buytenhek wrote:
Hello!
I've been running into an issue with background fstrim on large xfs
filesystems on RAID10d SSDs taking a lot of time to complete and
starving out other I/O to the filesystem. There seem to be a few
different issues involved here, but the main one appears to be that
BLKDISCARD on a RAID10 md block device sends many small discard
requests down to the underlying component devices (while this doesn't
seem to be an issue for RAID0 or for RAID1).
It seems to have super weird friction with blkdiscard sized that are not
multiple of the chunk - and as a result did very werid things.
If you force a size that is nominally a multiple of one (from my
testings) it will work with sensible speed (in context of raid10).
You can find more in the thread I did some time ago:
https://www.spinics.net/lists/raid/msg62094.html
While this was originally about raid456 (different issue there), check out:
https://www.spinics.net/lists/raid/msg62115.html
https://www.spinics.net/lists/raid/msg62134.html
From blktraces you can see it sent e.g. single sized blkdiscards
backwards across the whole array.