4 ms·
Almost all laptops these days come with SSDs and last I checked, OpenBSD doesn't support TRIM. Has this been fixed? Is lack of TRIM a non-issue?
by nemesisrobot 11y ago
Almost all laptops these days come with SSDs and last I checked, OpenBSD doesn't support TRIM. Has this been fixed? Is lack of TRIM a non-issue?
- bcook 11y agoI thought SSDs were integrating TRIM into the drive's firmware/controller nowadays.
- ultramancool 11y agoThat's impossible (AFAIK at least) - the drives can't know what parts of the filesystem are in use, only the OS can.
- bcook 11y agoA quick Googling shows it exists only in high-end SSDs, but the information is from 2013. Just anecdotally, my Nexus 9 does not even have the fstrim command anymore, nor do I see any discard options in the fstab. My Nexus 7 2012 had lots of interest about fstrim improving performance, but not my Nexus 9. I assumed the TRIM issue had disappeared.
- mondoshawan 11y agoUhh... The nexus 7 and 9? You realize those have SD and MMC cards soldered to the motherboards and work /entirely/ unlike an SSD, right? Also, the OP is right: TRIM works by telling the SSD which blocks that were previously used are now unused, so that the SSD, at a lower level, can eventually erase the larger flash sector. There is literally no way for the SSD to know this intrinsically because SSDs do not expose a filesystem interface.
- bcook 11y agoRegardless of the differences, the Nexus 7 used trim (introduced in Android 4.3) on it's flash-based (SSD also uses flash) solid-state memory and my Nexus 9 does not. The trim "bug" is well known for some Android devices, but now it has died off. I was attempting to guess why. Another quick Googling seems to say improved garbage collection (in the SSD itself) has lessened the need for fstrim. Hopefully someone who is knowledgeable will chime in.
- gnoway 11y agotrim is implemented in the controller in that a controller implementing trim is capable of receiving, understanding and acting upon the trim command. It's actually issued higher up in the stack; I've only ever seen it mentioned in the context of an OS issuing the command to the drive if a file on a filesystem on the drive is deleted, or if a utility intended to issue trim against all empty blocks was run. You're correct in that trim is less necessary if a drive has good garbage collection. I don't know anything about the implementation of either, but I would expect trim to be easier, cheaper and better than GC. It seems like GC would require work to discover/remember things provided as input w/ trim. I've assumed that GC was only implemented by vendors in their controllers because trim wasn't available in the popular OSs yet, and/or because their controllers were already doing most of the work required by GC anyway so it was cheap to implement. Finally, you can't equate SSDs with the SD or eMMC used in some of the phones/tablets. Yes it's all flash, but an SSD is typically multi-channel with many flash modules, a DRAM cache and a much more sophisticated controller implementing a standard storage interface (AHCI/SATA or SAS or NVMe). eMMC and SD are much simpler, cheaper and slower.
- bcook 11y agoMy point was that they are equal from the fstrim perspective.
- monocasa 11y agoNot saying that you're wrong, but SD cards for example assume that they're going to be running FAT and make assumptions/optimizations based on that.
- geggam 11y agoBeen using an SSD in my laptop for 6 months now... UFS / FFS doesnt really seem to fragment that much # fsck / | grep frag 6395 files, 106651 used, 409612 free (300 frags, 51164 blocks, 0.1% fragmentation) # fsck /usr | grep frag 396741 files, 4832173 used, 19820289 free (4953 frags, 2476917 blocks, 0.0% fragmentation) # fsck /home | grep frag 1192199 files, 27780639 used, 3176062 free (216374 frags, 369961 blocks, 0.7% fragmentation)
- delan 11y agoThe effect of fragmentation on file systems on SSDs is minimal, and fragmentation is not related to TRIM. http://askubuntu.com/a/537211/1624 http://askubuntu.com/a/537211/1624
- fpoling 11y agoDue to TRIM bugs I just follow an advise of never using it. Rather I set aside like 5% of disk that is never touched. This works with both old and new SSD without affecting long-term performance on laptops. As an added bonus it makes full-disk encryption more sound.
- ben_bai 11y agohttp://www.tedunangst.com/flak/post/lessons-learned-about-TRIM http://www.tedunangst.com/flak/post/lessons-learned-about-TR... I do believe it supports trim, since 2011. Need to check the code if and how it's implemented today. I'm using 2 SSDs in a RAID-0 with OpenBSD for 1 year now. No problems and lightning fast.