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

Fix synchronous behavior in __vdev_disk_physio() #3833

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

Commit b39c22b set the READ_SYNC and WRITE_SYNC flags for a bio
based on the ZIO_PRIORITY_* flag passed in. This had the unnoticed
side-effect of making the vdev_disk_io_start() synchronous for
certain I/Os.

This in turn resulted in vdev_disk_io_start() being able to
re-dispatch zio's which would result in a RCU stalls when a disk
was removed from the system. Additionally, this could negatively
impact performance and may explain the performance regressions
reported in both #3829 and #3780.

This patch resolves the issue by making the blocking behavior
dependant on a 'wait' flag being passed rather than overloading
the passed bio flags.

Finally, the WRITE_SYNC and READ_SYNC behavior is restricted to
non-rotational devices where there is no benefit to queuing to
aggregate the I/O.

Signed-off-by: Brian Behlendorf [email protected]
Issue #3780
Issue #3829
Issue #3652

Commit b39c22b set the READ_SYNC and WRITE_SYNC flags for a bio
based on the ZIO_PRIORITY_* flag passed in.  This had the unnoticed
side-effect of making the vdev_disk_io_start() synchronous for
certain I/Os.

This in turn resulted in vdev_disk_io_start() being able to
re-dispatch zio's which would result in a RCU stalls when a disk
was removed from the system.  Additionally, this could negatively
impact performance and may explain the performance regressions
reported in both openzfs#3829 and openzfs#3780.

This patch resolves the issue by making the blocking behavior
dependant on a 'wait' flag being passed rather than overloading
the passed bio flags.

Finally, the WRITE_SYNC and READ_SYNC behavior is restricted to
non-rotational devices where there is no benefit to queuing to
aggregate the I/O.

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#3780
Issue openzfs#3829
Issue openzfs#3652
@behlendorf
Copy link
Contributor Author

@bprotopopov could you please review this change. Your earlier commit b39c22b resulted in a few unexpected side effects this patch is designed to address.

@behlendorf
Copy link
Contributor Author

Merged as:

5592404 Fix synchronous behavior in __vdev_disk_physio()

@bprotopopov
Copy link
Contributor

@behlendorf, the change looks good.

Needless to say, I am a bit surprised with the outcome of the original commit. It seems that this behavior is kernel version dependent as on Centos 6.5/6.6, I did not see a slowdown when ZIL is not on SLOG.

@behlendorf behlendorf closed this Sep 30, 2015
@behlendorf behlendorf deleted the issue-3652 branch April 19, 2021 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants