mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Implemented zpool scrub pause/resume
Currently, there is no way to pause a scrub. Pausing may be useful when the pool is busy with other I/O to preserve bandwidth. This patch adds the ability to pause and resume scrubbing. This is achieved by maintaining a persistent on-disk scrub state. While the state is 'paused' we do not scrub any more blocks. We do however perform regular scan housekeeping such as freeing async destroyed and deadlist blocks while paused. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Thomas Caputi <tcaputi@datto.com> Reviewed-by: Serapheim Dimitropoulos <serapheimd@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alek Pinchuk <apinchuk@datto.com> Closes #6167
This commit is contained in:
@@ -765,6 +765,16 @@ typedef enum pool_scan_func {
|
||||
POOL_SCAN_FUNCS
|
||||
} pool_scan_func_t;
|
||||
|
||||
/*
|
||||
* Used to control scrub pause and resume.
|
||||
*/
|
||||
typedef enum pool_scrub_cmd {
|
||||
POOL_SCRUB_NORMAL = 0,
|
||||
POOL_SCRUB_PAUSE,
|
||||
POOL_SCRUB_FLAGS_END
|
||||
} pool_scrub_cmd_t;
|
||||
|
||||
|
||||
/*
|
||||
* ZIO types. Needed to interpret vdev statistics below.
|
||||
*/
|
||||
@@ -797,6 +807,9 @@ typedef struct pool_scan_stat {
|
||||
/* values not stored on disk */
|
||||
uint64_t pss_pass_exam; /* examined bytes per scan pass */
|
||||
uint64_t pss_pass_start; /* start time of a scan pass */
|
||||
uint64_t pss_pass_scrub_pause; /* pause time of a scurb pass */
|
||||
/* cumulative time scrub spent paused, needed for rate calculation */
|
||||
uint64_t pss_pass_scrub_spent_paused;
|
||||
} pool_scan_stat_t;
|
||||
|
||||
typedef enum dsl_scan_state {
|
||||
|
||||
Reference in New Issue
Block a user