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

Misc zevent improvements #11822

Closed
wants to merge 2 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Mar 31, 2021

Motivation and Context

Fixing some issues that were identified while looking into zevent handling.

Description

ratelimit_dropped isn't protected by a lock. We must atomically read and clear the value.

Use a fixed default value for zfs_zevent_len_max rather than scaling by CPUs. The lower bound was too low and the upper bound was too high. 512 is a reasonable default value.

How Has This Been Tested?

ZTS sanity

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@ghost ghost added the Status: Code Review Needed Ready for review and testing label Mar 31, 2021
@ghost ghost requested a review from behlendorf March 31, 2021 18:38
Ryan Moeller added 2 commits March 31, 2021 14:51
ratelimit_dropped isn't protected by a lock.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost ghost force-pushed the zevent-misc branch from 2ad2939 to 800b28e Compare March 31, 2021 18:52
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 1, 2021
@behlendorf behlendorf closed this in 3ba10f9 Apr 1, 2021
behlendorf pushed a commit that referenced this pull request Apr 1, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
@ghost ghost deleted the zevent-misc branch April 1, 2021 15:56
behlendorf pushed a commit that referenced this pull request Apr 7, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
behlendorf pushed a commit that referenced this pull request Apr 7, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
adamdmoss pushed a commit to adamdmoss/zfs that referenced this pull request Apr 10, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
adamdmoss pushed a commit to adamdmoss/zfs that referenced this pull request Apr 10, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
@h1z1
Copy link

h1z1 commented May 2, 2021

@freqlabs did you test clearing thousands of events as part of this? Ran into an issue last week where a system was pausing for some reason. Turned out a user set zfs_deadman_ziotime_ms way too low (10ms), which was spamming events. Clearing them (60k+) alone completely froze the host.

@ghost
Copy link
Author

ghost commented May 3, 2021

I'm not sure how you would have thousands of events queued when this sets the max queue length to 512?

@h1z1
Copy link

h1z1 commented May 4, 2021

It shouldn't, question was did you run into that as well and would it be resolved along with this change. Spose either way events shouldn't cause the freezing.

Worth noting this thread - #11966

Which I'm locked out of, has the potential to cause similar issues.

@ghost
Copy link
Author

ghost commented May 4, 2021

No I didn't test clearing thousands of events. I don't think these changes will help whatever is going on there, but it will help ensure the reported number of dropped events due to rate limiting is accurate.

ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 7, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 7, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 13, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
ghost pushed a commit to truenas/zfs that referenced this pull request May 13, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
behlendorf pushed a commit that referenced this pull request May 20, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
behlendorf pushed a commit that referenced this pull request May 20, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11822
tonyhutter pushed a commit that referenced this pull request Jun 23, 2021
ratelimit_dropped isn't protected by a lock and is expected to
be updated atomically.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
tonyhutter pushed a commit that referenced this pull request Jun 23, 2021
The lower bound for this scaling to too low and the upper bound is too
high.  Use a fixed default length of 512 instead, which is a reasonable
value on any system.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11822
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.

2 participants