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

Don't wakeup unnecessarily in 'zpool events -f' #9091

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

DeHackEd
Copy link
Contributor

Signed-off-by: DHE git@dehacked.net

Motivation and Context

A user in IRC came in complaining that zed was preventing his laptop CPU from properly sleeping. Traced it down to this.

Description

Rather than quasi-busy-waiting in the zevents code, just go to sleep and wait for a wakeup.

How Has This Been Tested?

Build-tested only at this point. It's late as I type this.

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:

Signed-off-by: DHE <git@dehacked.net>
@DeHackEd
Copy link
Contributor Author

Is there a good reason for the polling-wait? I can't think of one.

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #9091 into master will increase coverage by 8.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9091      +/-   ##
==========================================
+ Coverage   70.83%   79.07%   +8.24%     
==========================================
  Files         351      401      +50     
  Lines      115431   121648    +6217     
==========================================
+ Hits        81760    96189   +14429     
+ Misses      33671    25459    -8212
Flag Coverage Δ
#kernel 79.65% <100%> (-0.01%) ⬇️
#user 67.02% <ø> (+11.03%) ⬆️

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 adf495e...95a6d78. Read the comment docs.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jul 29, 2019
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I agree. We shouldn't need to periodically wake up, when an event in posted it's broadcast to the CV so we'll get notified.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jul 30, 2019
@ahrens ahrens merged commit 99e755d into openzfs:master Aug 5, 2019
allanjude pushed a commit to allanjude/zfs that referenced this pull request Aug 12, 2019
ZED can prevent CPU's from properly sleeping.

Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes openzfs#9091
allanjude pushed a commit to allanjude/zfs that referenced this pull request Oct 13, 2019
ZED can prevent CPU's from properly sleeping.

Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes openzfs#9091
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 24, 2019
ZED can prevent CPU's from properly sleeping.

Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes openzfs#9091
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
ZED can prevent CPU's from properly sleeping.

Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes openzfs#9091
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
ZED can prevent CPU's from properly sleeping.

Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes #9091
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.

4 participants