![]() |
Support for TRIM / Discard?
Current SSD's support TRIMming, where the OS tells the drive whenever data blocks are no longer used and can be freed by the drive. It helps with longevity and performance, as the drive has empty blocks available for wear leveling and ready to write new data to.
Linux supports this since many years, and Btrfs has a mount option to enable it. On the Jolla1, this does not appear to be enabled: Code:
[nemo@Sailfish ~]$ cat /sys/block/mmcblk0/queue/discard_zeroes_data Code:
[nemo@Sailfish ~]$ cat /sys/block/mmcblk1/queue/discard_zeroes_data edit: not sure whether discard_zeroes_data actually means TRIM is supported. On my two home machines with SSD with TRIM support it also says "0", even though an "fstrim" actually seems to do something. On Ubuntu, fstrim is scheduled to run once a week by default. Questions:
|
Re: Support for TRIM / Discard?
Digging a bit further into this, the source code of fstrim uses discard_granularity to see whether trim is supported.
And lo and behold: Code:
[nemo@Sailfish ~]$ cat /sys/block/mmcblk0/queue/discard_granularity |
Re: Support for TRIM / Discard?
Quote:
Means that in case of discard, you can just emit the TRIM command on queue. You need to flush the whole command queue, wait of it to get written on the flash media, then issue the TRIM command, wait for completion, and then resume normal operation. Each discard is accompanied with a delay. The best wait to use TRIM is as part of your "normal btrfs maintenance" routine :
|
Re: Support for TRIM / Discard?
AFAIK, the delay caused by TRIM is indeed the reason that distributions like Ubuntu by default schedule a fstrim once a week. On the JP1, a btrfs balance is also scheduled to run once a week (Tue 3:00, in /lib/systemd/system/btrfs-balancer.timer). Running a fstrim afterwards would be ideal, I guess. Well, it seems it was scheduled, as the timer is now disabled?!
But I thought fstrim wasn't available on Sailfish. I was wrong, it is available, in /sbin/fstrim, it just isn't in the path. So screw it, I did a btrfs balance and I ran fstrim afterwards: Code:
[root@Sailfish nemo]# /sbin/fstrim -a -v So, I can't tell whether or not it does something useful. And whether it helps with the occasional temporary freeze I have remains to be seen. But it seems it doesn't break things, as far as I can tell yet anyway. |
All times are GMT. The time now is 22:02. |
vBulletin® Version 3.8.8