[linux-lvm] Is TRIM and DISCARD needed for normal HDD ?

Zdenek Kabelac zkabelac at redhat.com
Thu Nov 26 11:01:33 UTC 2020


Dne 25. 11. 20 v 16:37 Sreyan Chakravarty napsal(a):
> Hi,
> 
> I am using thin LVM pools, but I have a normal hard disk and not a SSD.
> 
> Is there any reason to enable TRIM and/or DISCARD for my HDD ?
> 
> I have heard it is only useful for a SSD. Will it offer any advantages in my 
> case ?
> 

Hi

Thin-pool is created by default with 'passdown' TRIM/discard support.

This means - discard to thin LV  (i.e. fstrim of ext4 on thinLV) gets 
propagated to thin-pool, where it may deallocate full chunk when possible 
(i.e. if you use  256K chunk, WHOLE chunk must be free to have an effective 
discard).

With "passdown" mode - such released chunks are also then passed through to 
origin _tdata device - where again some 'alignment rules' of discardable 
regions applie (i.e. lot of SSD need 512KiB blocks).

If you have HDD - then clearly such discard stops at thin-pool level 
(automatically) and just releases chunks in thin-pool for future reuse.

"ignore" discard mode is usefull in the case you want to keep already 
'allocated' chunks for thin LV always there - and also in some case it may 
make timing more predictible - as discard requires processing - so it ma 
slowdown few things - but at the expense of more filled thin-pool....

Hopefully this makes it clear.

Regards

Zdenek




More information about the linux-lvm mailing list