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
Make txg_wait_synced conditional in zfsvfs_teardown #9115
Conversation
| for (int t = 0; t < TXG_SIZE; t++) { | ||
| os_dirty = dmu_objset_is_dirty(os, t); | ||
| if (os_dirty) | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] I think this would be slightly easier to read as:
if (dmu_objset_is_dirty(...)) {
os_dirty = B_TRUE;
break;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Matt I made that change.
The call to txg_wait_synced in zfsvfs_teardown should be made conditional on the objset having dirty data. This can prevent unnecessary txg_wait_synced during some unmount operations. Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Codecov Report
@@ Coverage Diff @@
## master #9115 +/- ##
==========================================
+ Coverage 79.18% 79.21% +0.02%
==========================================
Files 400 400
Lines 121692 121656 -36
==========================================
+ Hits 96360 96367 +7
+ Misses 25332 25289 -43
Continue to review full report at Codecov.
|
The call to txg_wait_synced in zfsvfs_teardown should be made conditional on the objset having dirty data. This can prevent unnecessary txg_wait_synced during some unmount operations. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#9115
The call to txg_wait_synced in zfsvfs_teardown should be made conditional on the objset having dirty data. This can prevent unnecessary txg_wait_synced during some unmount operations. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#9115
The call to txg_wait_synced in zfsvfs_teardown should be made conditional on the objset having dirty data. This can prevent unnecessary txg_wait_synced during some unmount operations. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes #9115
The call to txg_wait_synced in zfsvfs_teardown should be made conditional on the objset having dirty data. This can prevent unnecessary txg_wait_synced during some unmount operations. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#9115 Signed-off-by: Bryant G. Ly <bly@catalogicsoftware.com> Conflicts: module/zfs/zfs_vfsops.c
The call to txg_wait_synced in zfsvfs_teardown should
be made conditional on the objset having dirty data.
This can prevent unnecessary txg_wait_synced during
some unmount operations.
Signed-off-by: Paul Zuchowski pzuchowski@datto.com
The function zfsvfs_teardown only skips txg_wait_synced if the objset is read-only. We can also avoid txg_wait_synced if the objset has no dirty data. Detect if the objset is dirty and don't call txg_wait_synced if it is not.
Motivation and Context
Applications that perform lots of sync tasks are already forcing txg_wait_synced. If the application also limits ZFS mounts by unmounting datasets after use, it could be helpful to performance to avoid txg_wait_synced during unmount when we can.
Description
Add to the conditional test for txg_wait_synced in zfsvfs_teardown.
How Has This Been Tested?
Ran the zfs test suite.
Types of changes
Checklist:
Signed-off-by.