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

Fix cpu hotplug atomic sleep issue #12714

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

pcd1193182
Copy link
Contributor

@pcd1193182 pcd1193182 commented Nov 2, 2021

Motivation and Context

See #12696

Description

We move the spinlock unlock before the thread creation. This should be safe because the thread creation code doesn't actually manipulate any taskq data structures; that's done by the thread once it's created. We also remove the assertion that the maxthreads is the current threads plus one; that assertion could fail if multiple hotplug events come in in quick succession, and the first new taskq thread hasn't had a chance to start processing yet.

How Has This Been Tested?

Manually tested CPU hotplug to verify stability, normal ZFS test suite. The patch has also been tested by people in the original issue, and it seems to have removed the BUG message.

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:

Signed-off-by: Paul Dagnelie <pcd@delphix.com>
@tonynguien tonynguien merged commit 58bf6af into openzfs:master Nov 2, 2021
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Nov 2, 2021
@satmandu satmandu mentioned this pull request Feb 25, 2022
13 tasks
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 1, 2022
We move the spinlock unlock before the thread creation. This should be
safe because the thread creation code doesn't actually manipulate any
taskq data structures; that's done by the thread once it's created.

We also remove the assertion that the maxthreads is the current threads
plus one; that assertion could fail if multiple hotplug events come in
quick succession, and the first new taskq thread hasn't had a chance to
start processing yet.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
eviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes openzfs#12714
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