Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZVOL write IO merging not working properly #8471

Closed
samuelxhu opened this issue Mar 2, 2019 · 2 comments
Closed

ZVOL write IO merging not working properly #8471

samuelxhu opened this issue Mar 2, 2019 · 2 comments
Labels
Type: Performance Performance improvement or performance problem Type: Unknown The Issue has not yet been categorized

Comments

@samuelxhu
Copy link

samuelxhu commented Mar 2, 2019

System information

Type Version/Name
Distribution Name ZFS on Linux
Distribution Version Centos 7
Linux Kernel 3.10
Architecture x-86
ZFS Version 0.6.5.X, 0.7.X
SPL Version 0.6.5.X, 0.7.X

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

@ahrens ahrens removed Missing Template Status: Feedback requested More information is requested labels Mar 26, 2019
@ahrens ahrens reopened this Mar 26, 2019
@behlendorf behlendorf added the Type: Performance Performance improvement or performance problem label Mar 27, 2019
@behlendorf
Copy link
Contributor

Duplicate of #8472, which contains the current discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Performance Performance improvement or performance problem Type: Unknown The Issue has not yet been categorized
Projects
None yet
Development

No branches or pull requests

4 participants
@behlendorf @ahrens @samuelxhu and others