mirror_zfs/cmd/zpool
Tom Caputi d4a72f2386 Sequential scrub and resilvers
Currently, scrubs and resilvers can take an extremely
long time to complete. This is largely due to the fact
that zfs scans process pools in logical order, as
determined by each block's bookmark. This makes sense
from a simplicity perspective, but blocks in zfs are
often scattered randomly across disks, particularly
due to zfs's copy-on-write mechanisms.

This patch improves performance by splitting scrubs
and resilvers into a metadata scanning phase and an IO
issuing phase. The metadata scan reads through the
structure of the pool and gathers an in-memory queue
of I/Os, sorted by size and offset on disk. The issuing
phase will then issue the scrub I/Os as sequentially as
possible, greatly improving performance.

This patch also updates and cleans up some of the scan
code which has not been updated in several years.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Authored-by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Authored-by: Alek Pinchuk <apinchuk@datto.com>
Authored-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #3625 
Closes #6256
2017-11-15 17:27:01 -08:00
..
zpool.d zpool iostat/status -c improvements 2017-06-05 10:52:15 -07:00
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.am Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zpool_iter.c Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zpool_main.c Sequential scrub and resilvers 2017-11-15 17:27:01 -08:00
zpool_util.c Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zpool_util.h Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zpool_vdev.c Use ashift=12 by default on SSDSC2BW48 disks 2017-10-23 11:00:45 -07:00