diff options
author | Alek P <[email protected]> | 2017-07-06 22:16:13 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-07-06 22:16:13 -0700 |
commit | 0ea05c64f8d08c20439dd2a06e949a2aa4115101 (patch) | |
tree | 28c543bbb096dfdb9809c754722445fa699d6ec4 /include/sys/fs | |
parent | 94b25662c51696ec081494e69efb5896566dede2 (diff) |
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 <[email protected]>
Reviewed by: Thomas Caputi <[email protected]>
Reviewed-by: Serapheim Dimitropoulos <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alek Pinchuk <[email protected]>
Closes #6167
Diffstat (limited to 'include/sys/fs')
-rw-r--r-- | include/sys/fs/zfs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index 7414eee5a..0ce35468f 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -766,6 +766,16 @@ typedef enum pool_scan_func { } 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. */ typedef enum zio_type { @@ -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 { |