TRIM should be treated as advisory by drives (i.e. it’s always a ‘best effort’ 
type of thing), so it _shouldn’t_ cause a problem for disks that don’t support 
it, though you’d probably need to try it to be sure. Worst case you could 
always set up a cron job to trim the specific vdev periodically.

Even with autotrim, this is recommended (though it’s in the context of a pool 
full of TRIMmable devices, I’m not sure how applicable it’d be to just a ZIL 
device). This gets a bit into the details but devices can also ignore TRIM 
requests that are too small for the device to do anything about.  Since 
autotrim generates TRIM requests for somewhat recently freed blocks, this can 
sometimes generate TRIM requests like that (which get ignored). By running a 
manual trim on occasion, it would allow ZFS to TRIM any ranges that might now 
be large enough for the disk to trim (but at the time were freed in chunks that 
were individually too small for the drive to TRIM at the time).


From: Kent Watsen <k...@watsen.net>
Date: Wednesday, April 28, 2021 at 11:19 AM
To: illumos-zfs <z...@lists.illumos.org>
Cc: illumos-discuss <discuss@lists.illumos.org>
Subject: Re: [zfs] [discuss] zpool add -o autotrim=on doesn't work?
Hi Jason,

Autotrim is set per zpool, not per vdev.

This appears to be the prevailing wisdom...

For an HDD-based raidz2 with an SSD-based ZIL/SLOG, should autotrim be on or 
off?

Is there any concern setting autotrim=on for HDDs, or would have no effect?  If 
no harm, then why isn’t autotrim=on the default?



You can also manually trim individual disk using ‘zpool trim pool disk’

Noted.  Thanks.


K.
illumos<https://illumos.topicbox.com/latest> / illumos-zfs / see 
discussions<https://illumos.topicbox.com/groups/zfs> + 
participants<https://illumos.topicbox.com/groups/zfs/members> + delivery 
options<https://illumos.topicbox.com/groups/zfs/subscription> 
Permalink<https://illumos.topicbox.com/groups/zfs/T6ef0a71646a80e63-M416dab156d94ac23053e6973>

------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/T6ef0a71646a80e63-Md1515edc48b3ba2a613ec75e
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to