Deleted Added
full compact
425a426,427
> extern int zfs_vdev_async_write_active_min_dirty_percent;
>
429,431d430
< uint64_t elapsed_nanosecs;
< unsigned int mintime;
<
446c445,459
< mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ?
---
> /*
> * We pause if:
> * - we have scanned for the maximum time: an entire txg
> * timeout (default 5 sec)
> * or
> * - we have scanned for at least the minimum time (default 1 sec
> * for scrub, 3 sec for resilver), and either we have sufficient
> * dirty data that we are starting to write more quickly
> * (default 30%), or someone is explicitly waiting for this txg
> * to complete.
> * or
> * - the spa is shutting down because this pool is being exported
> * or the machine is rebooting.
> */
> int mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ?
448,449c461,463
< elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
< if (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
---
> uint64_t elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
> int dirty_pct = scn->scn_dp->dp_dirty_total * 100 / zfs_dirty_data_max;
> if (elapsed_nanosecs / NANOSEC >= zfs_txg_timeout ||
451c465,466
< txg_sync_waiting(scn->scn_dp)) ||
---
> (txg_sync_waiting(scn->scn_dp) ||
> dirty_pct >= zfs_vdev_async_write_active_min_dirty_percent)) ||