Re: how to tell if TRIM is working

From: mike tancsa <mike_at_sentex.net>
Date: Thu, 02 May 2024 14:19:51 UTC
On 5/2/2024 10:16 AM, Warner Losh wrote:
>
> When trims are fast, you want to send them to the drive as soon as you
> know the blocks are freed. UFS always does this (if trim is enabled at 
> all).
> ZFS has a lot of knobs to control when / how / if this is done.
>
> vfs.zfs.vdev.trim_min_active: 1
> vfs.zfs.vdev.trim_max_active: 2
> vfs.zfs.trim.queue_limit: 10
> vfs.zfs.trim.txg_batch: 32
> vfs.zfs.trim.metaslab_skip: 0
> vfs.zfs.trim.extent_bytes_min: 32768
> vfs.zfs.trim.extent_bytes_max: 134217728
> vfs.zfs.l2arc.trim_ahead: 0
>
> I've not tried to tune these in the past, but you can see how they affect things.
>
Thanks Warner, I will try and play around with these values to see if 
they impact things.  BTW, do you know what / why things would be 
"skipped" during trim events ?

kstat.zfs.zrootoffs.misc.iostats.trim_bytes_failed: 0
kstat.zfs.zrootoffs.misc.iostats.trim_extents_failed: 0
kstat.zfs.zrootoffs.misc.iostats.trim_bytes_skipped: 5968330752
kstat.zfs.zrootoffs.misc.iostats.trim_extents_skipped: 503986
kstat.zfs.zrootoffs.misc.iostats.trim_bytes_written: 181593186304
kstat.zfs.zrootoffs.misc.iostats.trim_extents_written: 303115