Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
zvol_disk_open()
waits for up tozfs_vdev_open_timeout_ms
(1 second by default) (e.g. if the block device does not exist). While in this loop, it callsschedule_timeout()
.Description
The problem is that
schedule_timeout()
may not actually cause the thread to go off-CPU. Per the "documentation" (comment in the source code):In my experience,
schedule_timeout()
never sleeps from this code path. This is especially noticeable ifzfs_vdev_open_timeout_ms
has been increased from its default.This commit uses
msleep()
to actually sleep. Note that this is how it was before #7629.How Has This Been Tested?
increasing
zfs_vdev_open_timeout_ms
and then importing a pool whose disks are no longer present on the system (/dev/...
links no longer exist)Types of changes
Checklist:
Signed-off-by
.