Lines Matching full:trim
41 * TRIM is a feature which is used to notify a SSD that some previously
47 * There are two supported TRIM methods; manual and automatic.
49 * Manual TRIM:
51 * A manual TRIM is initiated by running the 'zpool trim' command. A single
53 * managing that vdev TRIM process. This involves iterating over all the
55 * required TRIM I/Os.
60 * the TRIM are regularly written to the pool. This allows the TRIM to be
63 * Automatic TRIM:
65 * An automatic TRIM is enabled by setting the 'autotrim' pool property
68 * core TRIM process as a manual TRIM, but with a few key differences.
70 * 1) Automatic TRIM happens continuously in the background and operates
76 * metaslab is disabled at a time. Unlike manual TRIM, this means each
77 * 'vdev_autotrim' thread is responsible for issuing TRIM I/Os for its
80 * 3) There is no automatic TRIM progress information stored on disk, nor
83 * While the automatic TRIM process is highly effective it is more likely
84 * than a manual TRIM to encounter tiny ranges. Ranges less than or equal to
86 * TRIM and are skipped. This means small amounts of freed space may not
93 * For this reason it may be beneficial to occasionally manually TRIM a pool
94 * even when automatic TRIM is enabled.
98 * Maximum size of TRIM I/O, ranges will be chunked in to 128MiB lengths.
103 * Minimum size of TRIM I/O, extents smaller than 32Kib will be skipped.
108 * Skip uninitialized metaslabs during the TRIM process. This option is
110 * TRIM operations are slow. As a pool ages an increasing fraction of
113 * manual TRIM and will persist for the duration of the requested TRIM.
118 * Maximum number of queued TRIM I/Os per leaf vdev. The number of
119 * concurrent TRIM I/Os issued to the device is controlled by the
127 * efficient TRIM operations, by allowing them to be aggregated longer,
133 * time. This can result is larger TRIM operations, and increased memory
143 * trimmed and a range tree containing the extents to TRIM. All provided
150 vdev_t *trim_vdev; /* Leaf vdev to TRIM */
152 zfs_range_tree_t *trim_tree; /* TRIM ranges (in metaslab) */
153 trim_type_t trim_type; /* Manual or auto TRIM */
154 uint64_t trim_extent_bytes_max; /* Maximum TRIM I/O size */
155 uint64_t trim_extent_bytes_min; /* Minimum TRIM I/O size */
156 enum trim_flag trim_flags; /* TRIM flags (secure) */
209 * The sync task for updating the on-disk state of a manual TRIM. This
288 * Update the on-disk state of a manual TRIM. This is called to request
289 * that a TRIM be started/suspended/canceled, or to change one of the
290 * TRIM options (partial, secure, rate).
316 * If we're activating, then preserve the requested rate and trim in vdev_trim_change_state()
352 spa_history_log_internal(spa, "trim", tx, in vdev_trim_change_state()
357 spa_history_log_internal(spa, "trim", tx, in vdev_trim_change_state()
364 spa_history_log_internal(spa, "trim", tx, in vdev_trim_change_state()
370 spa_history_log_internal(spa, "trim", tx, in vdev_trim_change_state()
384 * The zio_done_func_t done callback for each manual TRIM issued. It is
385 * responsible for updating the TRIM stats, reissuing failed TRIM I/Os,
386 * and limiting the number of in flight TRIM I/Os.
425 * The zio_done_func_t done callback for each automatic TRIM issued. It
426 * is responsible for updating the TRIM stats and limiting the number of
427 * in flight TRIM I/Os. Automatic TRIM I/Os are best effort and are
455 * The zio_done_func_t done callback for each TRIM issued via
456 * vdev_trim_simple(). It is responsible for updating the TRIM stats and
457 * limiting the number of in flight TRIM I/Os. Simple TRIM I/Os are best
484 * Returns the average trim rate in bytes/sec for the ta->trim_vdev.
494 * Issues a physical TRIM and takes care of rate limiting (bytes/sec)
495 * and number of concurrent TRIM I/Os.
507 * Limit manual TRIM I/Os to the requested rate. This does not in vdev_trim_range()
508 * apply to automatic TRIM since no per vdev rate can be specified. in vdev_trim_range()
585 * Issues TRIM I/Os for all ranges in the provided ta->trim_tree range tree.
586 * Additional parameters describing how the TRIM should be performed must
632 * returning. TRIM zios have lower priority over regular or syncing in vdev_trim_ranges()
633 * zios, so all TRIM zios for this metaslab must complete before the in vdev_trim_ranges()
635 * this metaslab could cut ahead of still queued TRIM zios for this in vdev_trim_ranges()
674 * Calculates the completion percentage of a manual TRIM.
748 * Load from disk the vdev's manual TRIM information. This includes the
749 * state, progress, and options provided when initiating the manual TRIM.
816 * Only a manual trim will be traversing the vdev sequentially. in vdev_trim_xlate_range_add()
817 * For an auto trim all valid ranges should be added. in vdev_trim_xlate_range_add()
870 * Each manual TRIM thread is responsible for trimming the unallocated
872 * over its top-level metaslabs and issuing TRIM I/O for the space described
909 * When a secure TRIM has been requested infer that the intent in vdev_trim_thread()
911 * minimum TRIM size to prevent ranges from being skipped. in vdev_trim_thread()
938 * If a partial TRIM was requested skip metaslabs which have in vdev_trim_thread()
985 * check to see if it needs to restart a trim. That thread will be in vdev_trim_thread()
1001 * Initiates a manual TRIM for the vdev_t. Callers must hold vdev_trim_lock,
1037 * Wait for vdev trim threads which were listed to cleanly exit.
1059 * required to call vdev_trim_stop_wait() to block for all the trim threads
1073 * Allow cancel requests to proceed even if the trim thread has in vdev_trim_stop()
1112 * Convenience function to stop trimming of a vdev tree and set all trim
1151 * Conditionally restarts a manual TRIM given its on-disk state.
1198 * Used by the automatic TRIM when ZFS_DEBUG_TRIM is set to verify that
1199 * every TRIM range is contained within ms_allocatable.
1213 * Each automatic TRIM thread is responsible for managing the trimming of a
1214 * top-level vdev in the pool. No automatic TRIM state is maintained on-disk.
1216 * N.B. This behavior is different from a manual TRIM where a thread
1260 * TRIM commands for a group evenly over the entire device. in vdev_autotrim_thread()
1278 * or when there are no recent frees to trim. in vdev_autotrim_thread()
1289 * This may happen when a manual TRIM or initialize in vdev_autotrim_thread()
1291 * of a manual TRIM, the ms_trim tree will have been in vdev_autotrim_thread()
1292 * vacated. Only ranges added after the manual TRIM in vdev_autotrim_thread()
1294 * These will be processed when the automatic TRIM in vdev_autotrim_thread()
1314 * trim trees for a metaslab. If the top-level vdev in vdev_autotrim_thread()
1317 * and a trim tree should be constructed for each. in vdev_autotrim_thread()
1372 * Issue the TRIM I/Os for all ranges covered by the in vdev_autotrim_thread()
1373 * TRIM trees. These ranges are safe to TRIM because in vdev_autotrim_thread()
1381 * Always yield to a manual TRIM if one has in vdev_autotrim_thread()
1394 * of the required TRIM I/Os. in vdev_autotrim_thread()
1420 * Wait for couples of kicks, to ensure the trim io is in vdev_autotrim_thread()
1643 * must check to see if it needs to restart a trim. That thread in vdev_trim_l2arc_thread()
1675 * Punches out TRIM threads for the L2ARC devices in a spa and assigns them
1686 * Locate the spa's l2arc devices and kick off TRIM threads. in vdev_trim_l2arc()
1694 * Don't attempt TRIM if the vdev is UNAVAIL or if the in vdev_trim_l2arc()
1695 * cache device was not marked for whole device TRIM in vdev_trim_l2arc()
1779 "Max size of TRIM commands, larger will be split");
1782 "Min size of TRIM commands, smaller will be skipped");
1788 "Min number of txgs to aggregate frees before issuing TRIM");