UFS UFS trim statistic

I have enabled TRIM by tunefs -t enable. Then I created file and deleted file back and forth. I want to know how many trims happen. Which command can help me?
 
gstat -d (d/s column)

Code:
-d Enable display of statistics for delete (BIO_DELETE) operations.

gstat -d -b -I 30s may help to collect the raw numbers over 30 seconds.
 
I was looking for it but couldn't find it. I did find the TRIM statistics for ZFS, in case someone stumbles on this thread, they're:
Code:
dice@armitage:~ % sysctl kstat.zfs.misc.zio_trim
kstat.zfs.misc.zio_trim.failed: 0
kstat.zfs.misc.zio_trim.unsupported: 508
kstat.zfs.misc.zio_trim.success: 0
kstat.zfs.misc.zio_trim.bytes: 0
 
have switched from UFS to ZFS. Yes, I can see the statistic for ZFS. But I found there are some failures for HDD. How can I check why those errors happen?
Code:
kstat.zfs.misc.zio_trim.failed: 925
kstat.zfs.misc.zio_trim.unsupported: 0
kstat.zfs.misc.zio_trim.success: 107
kstat.zfs.misc.zio_trim.bytes: 1769268224
But for SDD, there is no failure:
Code:
kstat.zfs.misc.zio_trim.failed: 0
kstat.zfs.misc.zio_trim.unsupported: 0
kstat.zfs.misc.zio_trim.success: 43
kstat.zfs.misc.zio_trim.bytes: 137441177600
 
On a non SSD ZFS Setup it should look like this to me:

Code:
vfs.zfs.trim.enabled: 1
kstat.zfs.misc.zio_trim.failed: 0
kstat.zfs.misc.zio_trim.unsupported: 10191
kstat.zfs.misc.zio_trim.success: 0
kstat.zfs.misc.zio_trim.bytes:

On a ZFS Setup with L2ARC SSD looks like this:

Code:
vfs.zfs.trim.enabled: 1
kstat.zfs.misc.zio_trim.bytes: 100662802231296
kstat.zfs.misc.zio_trim.success: 52765121
kstat.zfs.misc.zio_trim.unsupported: 5193
kstat.zfs.misc.zio_trim.failed: 0

What kind of SSD is used? AHCI is enabled?
Code:
camcontrol identify ada0
output would be interesting, except the serial number.
 
The above errors occur when I run FreeBSD on Azure with ZFS + HDD. Azure uses remote storage as SDD, so I cannot detect what kinds of SSD is used from VM side.
But if I run FreeBSD on Hyper-v with ZFS + HDD, there is no trim failures. So, I guess the failures should be caused by some differences on disk configurations on Azure and Hyper-v.

If I can change some ZFS parameters to check why TRIM failures happened, that is helpful.

I saw there are a lot of other statistics for "kstat.zfs.misc", I'm trying to find any clues.
 
Back
Top