ZVOL write IO merging not working properly #8471
Labels
Type: Performance
Performance improvement or performance problem
Type: Unknown
The Issue has not yet been categorized
System information
Describe the problem you're observing
Before 0.6.5.X, e.g. 0.6.3-1.3 or 0.6.4.2, ZoL had the standard linux block device layer for ZVOL, thus one can use scheduler, deadline or others, to merge incoming IO requests. Even with the simplest noop scheduler, contiguous IO requests could still merge if they are sequential.
Things changed from 0.6.5.X on, Rao re-wrote the block layer of ZVOL, and disabled request merging at ZVOL layer, claiming that DMU does IO merging. However it seems that DMU IO merging either not work properly, or DMU IO merging is not sufficient from the performance point of view.
The problem is as follows. ZVOL has a volblocksize setting, and in many cases, e.g. for hosting VM, it is set to 32KB or so. When IO requests has a request size less than the volblocksize, read-modify-writes (RMW) will occur, leading to performance degradation. A scheduler, such as deadline, is capable of sorting and merging IO request, thus reducing the chance of RMW.
Describe how to reproduce the problem
Create a not-so-big ZVOL with volblocksize of 32KB, use FIO to issue a single sequential write IO workload of 4KB, after a while (after the ZVOL filled with some data), either using "iostat -mx 1 10 " or "zpool iostat 1 10", one can see there are a lot of read-modify-writes. Note that at the beginning of writes, there will be less or no RMW because ZVOL is almost empty and ZFS can intelligently skip reading zeros.
In contrast, use FIO to issue sequential write IO workload of 32KB, 64KB, or even larger, no matter how long you run the workload, there is no RMW.
Apparently request IO merging logic at ZVOL is not working properly. Either we re-enable block device scheduler choice of deadline or noop, or fix the broken IO merging logic in DMU, should fix this performance issue.
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: