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

Add zfs_vdev_parallel_open_enabled module option #6093

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions man/man5/zfs-module-parameters.5
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,21 @@ queue's min_active. See the section "ZFS I/O SCHEDULER".
Default value: \fB1,000\fR.
.RE

.sp
.ne 2
.na
\fBzfs_vdev_parallel_open_enabled\fR (int)
.ad
.RS 12n
Accelerates vdev opening during pool import by allowing all devices to be
opened in parallel. This should be enabled for pools constructed from
independent physical devices. For configurations where a zvol from one pool
is used as vdev in another this option should be disabled. This is needed
in order to avoid a potential deadlock during pool import.
.sp
Use \fB1\fR for yes (default) and \fB0\fR for no.
.RE

.sp
.ne 2
.na
Expand Down
13 changes: 12 additions & 1 deletion module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
*/
int metaslabs_per_vdev = 200;

/*
* Allow a system administrator to disable the parallel vdev open
* optimization so it's semi-safe to layer pools on top of zvols.
*/
int zfs_vdev_parallel_open_enabled = 1;

/*
* Virtual device management.
*/
Expand Down Expand Up @@ -1159,7 +1165,7 @@ vdev_uses_zvols(vdev_t *vd)
int c;

#ifdef _KERNEL
if (zvol_is_zvol(vd->vdev_path))
if (zfs_vdev_parallel_open_enabled == 0 || zvol_is_zvol(vd->vdev_path))
return (B_TRUE);
#endif

Expand Down Expand Up @@ -3703,7 +3709,12 @@ EXPORT_SYMBOL(vdev_degrade);
EXPORT_SYMBOL(vdev_online);
EXPORT_SYMBOL(vdev_offline);
EXPORT_SYMBOL(vdev_clear);

/* BEGIN CSTYLED */
module_param(zfs_vdev_parallel_open_enabled, int, 0644);
MODULE_PARM_DESC(zfs_vdev_parallel_open_enabled,
"Open vdev children in parallel during import.");

module_param(metaslabs_per_vdev, int, 0644);
MODULE_PARM_DESC(metaslabs_per_vdev,
"Divide added vdev into approximately (but no more than) this number "
Expand Down