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

Upstream: zil_commit_waiter() can stall forever #10445

Merged
merged 1 commit into from
Jun 14, 2020

Conversation

lundman
Copy link
Contributor

@lundman lundman commented Jun 12, 2020

On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1
we loop forever. The conditional was tweaked to ignore signedness.

Motivation and Context

Stall forever from fsync.

Description

By testing directly against -1, it does not matter if it is interpreted as signed or unsigned. Ie, no greater-than usage. Unfortunately clock_t is defined by OS.

How Has This Been Tested?

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.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1
we loop forever. The conditional was tweaked to ignore signedness.

Signed-off-by: Jorgen Lundman <[email protected]>
@codecov
Copy link

codecov bot commented Jun 12, 2020

Codecov Report

Merging #10445 into master will decrease coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10445      +/-   ##
==========================================
- Coverage   79.58%   79.39%   -0.19%     
==========================================
  Files         391      391              
  Lines      123872   123872              
==========================================
- Hits        98586    98354     -232     
- Misses      25286    25518     +232     
Flag Coverage Δ
#kernel 79.97% <100.00%> (-0.06%) ⬇️
#user 64.57% <100.00%> (-1.55%) ⬇️
Impacted Files Coverage Δ
module/zfs/zil.c 93.03% <100.00%> (+1.78%) ⬆️
module/os/linux/spl/spl-kmem-cache.c 75.58% <0.00%> (-8.50%) ⬇️
module/zfs/vdev_indirect.c 73.33% <0.00%> (-7.34%) ⬇️
module/zfs/vdev_removal.c 94.05% <0.00%> (-3.43%) ⬇️
module/zfs/dsl_scan.c 83.10% <0.00%> (-2.83%) ⬇️
module/zfs/zio_compress.c 89.74% <0.00%> (-2.57%) ⬇️
module/zfs/dsl_synctask.c 92.40% <0.00%> (-2.54%) ⬇️
cmd/ztest/ztest.c 78.05% <0.00%> (-2.08%) ⬇️
module/zfs/vdev_indirect_mapping.c 97.10% <0.00%> (-1.45%) ⬇️
module/zcommon/zfs_uio.c 87.75% <0.00%> (-1.03%) ⬇️
... and 45 more

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 e08b993...761aeb6. Read the comment docs.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 12, 2020
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 14, 2020
@behlendorf behlendorf merged commit 4f73576 into openzfs:master Jun 14, 2020
@ghost
Copy link

ghost commented Jun 15, 2020

We don't return -1 we return the delta, so this doesn't work for FreeBSD. That would be why stable/12 failed miserably. Looks like we have a few other mistakes to fix in our condvars too, so thanks :)

@behlendorf
Copy link
Contributor

@freqlabs thanks for commenting. After talking with @mattmacy the plan is to get the FreeBSD condvars aligned with the other implementations as quickly as possible.

lundman referenced this pull request in openzfsonosx/openzfs Jun 19, 2020
On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1
we loop forever. The conditional was tweaked to ignore signedness.

Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes #10445
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1
we loop forever. The conditional was tweaked to ignore signedness.

Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#10445
@lundman lundman deleted the macOS_pr5 branch May 28, 2021 05:21
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1
we loop forever. The conditional was tweaked to ignore signedness.

Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#10445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants