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

zv_suspend_lock in zvol_open()/zvol_release() #6342

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

bprotopopov
Copy link
Contributor

@bprotopopov bprotopopov commented Jul 12, 2017

Acquire zv_suspend_lock on first open and last close only.

Signed-off-by: Boris Protopopov boris.protopopov@actifio.com

Description

zv_suspend_lock is being acquired in zvol_open()/zvol_release() unconditionally. This lock might be held for a long time across zvol_suspend()/zvol_resume() (e.g. during zfs recv), and therefore, it is desirable to avoid taking the lock, unless it is actually needed (at the time of the first open and last close).

Motivation and Context

Improve concurrency and latency of the zvol_open()/zvol_release() operations.

This is related to #6263 in that it might make it simpler to reproduce the issue.

How Has This Been Tested?

standard zfs-test run

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

@bprotopopov
Copy link
Contributor Author

Turned the crank to re-run the tests.

@bprotopopov
Copy link
Contributor Author

It appears that SPL build is broken for Kernel.org kernel ?

@behlendorf
Copy link
Contributor

@bprotopopov yes. The 4.12 kernel was released a week ago allowing more disruptive changes to be merged for the latest kernel. We'll need to look in to exact what changes and add some additional compatibility code to deal with it. Ignore those failures for now.

@bprotopopov
Copy link
Contributor Author

zvol_misc_002_pos seems to be failing on Fedora 26 with

...
17:28:21.54 SUCCESS: mount /dev/zvol/testpool/testvol /var/tmp/testdir
17:28:22.14 write failed (-1), good_writes = 2, error: No space left on device[28]
...

@behlendorf
Copy link
Contributor

#6297 was opened to track the zvol_misc_002_pos failures weren't seeing on the latest Fedora and Ubuntu kernels.

@bprotopopov
Copy link
Contributor Author

@behlendorf could this be a test VM configuration issue (not enough disk space provisioned) ?

@behlendorf
Copy link
Contributor

@bprotopopov when you get a moment could you please rebase this on master.

@bprotopopov
Copy link
Contributor Author

@behlendorf will do

@sempervictus
Copy link
Contributor

This has run in our test cloud for a couple of weeks - along with the zil pipelining, zvol backed cinder ops are noticeably snappier.

Acquire zv_suspend_lock on first open and last close only.

Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
@bprotopopov
Copy link
Contributor Author

rebased on master

@behlendorf behlendorf merged commit 5146d80 into openzfs:master Aug 9, 2017
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 23, 2018
Acquire zv_suspend_lock on first open and last close only.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Closes openzfs#6342
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 5, 2018
Acquire zv_suspend_lock on first open and last close only.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Closes openzfs#6342
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.

3 participants