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

OpenZFS 9577 - remove zfs_dbuf_evict_key tsd #7602

Closed
wants to merge 1 commit into from

Conversation

behlendorf
Copy link
Contributor

@behlendorf behlendorf commented Jun 4, 2018

Description

The zfs_dbuf_evict_key TSD (thread-specific data) is not necessary -
we can instead pass a flag down in a few places to prevent recursive
dbuf eviction. Making this change has 3 benefits:

  1. The code semantics are easier to understand.
  2. On Linux, performance is improved, because creating/removing
    TSD values (by setting to NULL vs non-NULL) is expensive, and
    we do it very often.
  3. According to Nexenta, the current semantics can cause a
    deadlock when concurrently calling dmu_objset_evict_dbufs()
    (which is rare today, but they are working on a "parallel
    unmount" change that triggers this more easily):

Porting Notes:

  • Minor conflict with OpenZFS 9337 which has not yet been ported.

Motivation and Context

OpenZFS-issue: https://illumos.org/issues/9577
OpenZFS-commit: openzfs/openzfs@68611d3
Upstream bug: DLPX-58547

Possibily the root cause of #6880.

How Has This Been Tested?

Locally compiled.

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.

The zfs_dbuf_evict_key TSD (thread-specific data) is not necessary -
we can instead pass a flag down in a few places to prevent recursive
dbuf eviction. Making this change has 3 benefits:

1. The code semantics are easier to understand.
2. On Linux, performance is improved, because creating/removing
   TSD values (by setting to NULL vs non-NULL) is expensive, and
   we do it very often.
3. According to Nexenta, the current semantics can cause a
   deadlock when concurrently calling dmu_objset_evict_dbufs()
   (which is rare today, but they are working on a "parallel
   unmount" change that triggers this more easily):

Porting Notes:
* Minor conflict with OpenZFS 9337 which has not yet been ported.

Authored by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Approved by:
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://illumos.org/issues/9577
OpenZFS-commit: openzfs/openzfs@68611d3
Upstream bug: DLPX-58547
@codecov
Copy link

codecov bot commented Jun 4, 2018

Codecov Report

Merging #7602 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7602      +/-   ##
==========================================
+ Coverage   77.43%   77.45%   +0.02%     
==========================================
  Files         362      362              
  Lines      110316   110314       -2     
==========================================
+ Hits        85418    85443      +25     
+ Misses      24898    24871      -27
Flag Coverage Δ
#kernel 78.15% <100%> (+0.17%) ⬆️
#user 66.41% <100%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8591298...e3d8b59. Read the comment docs.

@behlendorf behlendorf changed the title OpenZSF 9577 - remove zfs_dbuf_evict_key tsd OpenZFS 9577 - remove zfs_dbuf_evict_key tsd Jun 4, 2018
@tonyhutter tonyhutter added this to To do in 0.7.13 Jan 7, 2019
@tonyhutter tonyhutter moved this from To do to In progress in 0.7.13 Jan 28, 2019
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Jan 30, 2019
The zfs_dbuf_evict_key TSD (thread-specific data) is not necessary -
we can instead pass a flag down in a few places to prevent recursive
dbuf eviction. Making this change has 3 benefits:

1. The code semantics are easier to understand.
2. On Linux, performance is improved, because creating/removing
   TSD values (by setting to NULL vs non-NULL) is expensive, and
   we do it very often.
3. According to Nexenta, the current semantics can cause a
   deadlock when concurrently calling dmu_objset_evict_dbufs()
   (which is rare today, but they are working on a "parallel
   unmount" change that triggers this more easily):

Porting Notes:
* Minor conflict with OpenZFS 9337 which has not yet been ported.

Authored by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://illumos.org/issues/9577
OpenZFS-commit: openzfs/openzfs#645
External-issue: DLPX-58547
Closes openzfs#7602
tonyhutter pushed a commit that referenced this pull request Mar 4, 2019
The zfs_dbuf_evict_key TSD (thread-specific data) is not necessary -
we can instead pass a flag down in a few places to prevent recursive
dbuf eviction. Making this change has 3 benefits:

1. The code semantics are easier to understand.
2. On Linux, performance is improved, because creating/removing
   TSD values (by setting to NULL vs non-NULL) is expensive, and
   we do it very often.
3. According to Nexenta, the current semantics can cause a
   deadlock when concurrently calling dmu_objset_evict_dbufs()
   (which is rare today, but they are working on a "parallel
   unmount" change that triggers this more easily):

Porting Notes:
* Minor conflict with OpenZFS 9337 which has not yet been ported.

Authored by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://illumos.org/issues/9577
OpenZFS-commit: openzfs/openzfs#645
External-issue: DLPX-58547
Closes #7602
@behlendorf behlendorf deleted the openzfs-9577 branch April 19, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.7.13
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants