George Wilson c10d37dd9f zfs initialize performance enhancements
PROBLEM
========

When invoking "zpool initialize" on a pool the command will
create a thread to initialize each disk. Unfortunately, it does
this serially across many transaction groups which can result
in commands taking a long time to return to the user and may
appear hung. The same thing is true when trying to suspend/cancel
the operation.

SOLUTION
=========

This change refactors the way we invoke the initialize interface
to ensure we can start or stop the intialization in just a few
transaction groups.

When stopping or cancelling a vdev initialization perform it
in two phases.  First signal each vdev initialization thread
that it should exit, then after all threads have been signaled
wait for them to exit.

On a pool with 40 leaf vdevs this reduces the vdev initialize
stop/cancel time from ~10 minutes to under a second.  The reason
for this is spa_vdev_initialize() no longer needs to wait on
multiple full TXGs per leaf vdev being stopped.

This commit additionally adds some missing checks for the passed
"initialize_vdevs" input nvlist.  The contents of the user provided
input "initialize_vdevs" nvlist must be validated to ensure all
values are uint64s.  This is done in zfs_ioc_pool_initialize() in
order to keep all of these checks in a single location.

Updated the innvl and outnvl comments to match the formatting used
for all other new sytle ioctls.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <george.wilson@delphix.com>
Closes #8230
2019-01-07 11:03:08 -08:00
..
2017-10-05 19:28:00 -07:00
2016-01-08 15:08:19 -08:00
2018-09-05 18:33:36 -07:00
2018-10-09 14:05:13 -07:00
2018-10-09 14:05:13 -07:00
2018-10-03 09:47:11 -07:00
2018-10-16 11:15:04 -07:00
2018-10-01 10:40:11 -07:00
2013-11-04 11:17:48 -08:00
2017-01-03 11:31:18 -06:00
2017-12-07 10:28:50 -08:00
2017-10-11 16:54:48 -04:00
2018-09-05 18:33:36 -07:00
2018-05-29 16:00:33 -07:00
2018-10-03 15:30:55 -07:00
2016-04-21 09:49:25 -07:00
2016-06-07 09:16:52 -07:00
2018-02-13 14:54:54 -08:00
2019-01-07 11:03:08 -08:00
2015-01-06 16:53:24 -08:00
2018-08-27 10:16:01 -07:00
2017-07-13 13:54:00 -04:00
2013-11-04 10:55:25 -08:00
2018-02-08 15:28:18 -08:00
2018-02-08 15:28:18 -08:00
2018-06-15 15:10:42 -07:00
2018-02-13 14:54:54 -08:00
2017-03-10 09:51:33 -08:00
2018-05-29 16:00:33 -07:00
2017-03-10 09:51:33 -08:00
2018-05-29 16:00:33 -07:00
2018-02-13 14:54:54 -08:00
2018-02-13 14:54:54 -08:00
2018-09-06 21:44:52 -07:00
2018-10-17 10:31:38 -07:00
2017-03-29 12:24:51 -07:00
2017-08-14 10:36:48 -07:00
2017-07-12 13:05:37 -07:00