OS/2, eCS & ArcaOS - Technical > Programming

Trim command

(1/4) > >>

Remy:
SSD may working slower after some time according how the SSD is used.

Do you know if ArcaOs or someone else  could implement a TRIM command under OS/2 ?
I found following link telling about TRIM
http://www.t13.org/Documents/MinutesDefault.aspx?keyword=trim

But I do not having the needed skills....

Cheers 

Dave Yeo:
Hi Remy, The Linux JFS does support trim so in theory a partition can be mounted under Linux and trimmed. It should be fine as IBM worked pretty hard to keep the JFS's compatible and if you mount a JFS volume under Mint, it is readable and writeable, the system even mounts it with case insensitivity.
Of course there is a danger so a good backup is required.
Likewise the trim code could be ported except for the license problem :) Too bad that whoever was working on OpenJFS moved on. And of course working on a file driver is hazardous as bugs will wipe out users data.
I've also wondered if simply backing up the SSD and writing zero's to the whole thing would trim it. As long as the controller is smart enough to notice the blocks that are pure zero's, I'd think it would work.
The other thing with SSD's and many modern hard drives is partitioning so that the JFS 4k blocks line up with the internal 4k blocks so that if writing eg one byte, it only affects one hardware block.

Dariusz Piatkowski:
Hi Remy,

When I was gearing up to toss a SSD into my machine I had asked the very same question. The general concensus was that OS/2 did not need this functionality b/c the SSD device itself would be handling this function. That answer never quite sat well with me though.

I am pretty certain that in the past when these devices were new technology the drivers and/or additional utility software itself implemented this functionality along with the OS. For example, the Samsung SSD FAQ (https://www.samsung.com/semiconductor/minisite/ssd/support/faqs-03/) clearly states the following:


--- Code: ---Q - Does Windows XP support the TRIM feature?

A - No, only Windows 7 and above supports the TRIM feature. The Samsung SSD Magician software enables you to manually use TRIM on both Windows XP and Windows Vista.

--- End code ---

The newer hardware on the other hand does appear to have some of this baked-in, or to be more precise it is the combination of OS FS and the hardware that makes it work. Basically, the current OSes have updated FS software which automatically notifies the SSD hardware when a particular block is no longer in use by the OS. That in turn allows the SSD firmware to "trim" accordingly, allowing the SSD firmware to implement wear levelling across it's entire storage cell body.

My experience is only based on working with the Samsung SSD: Evo850 and Pro970 (that's in my Win10 box).

Now, there is a Linux TRIM solution, it is the fstrim command which does not require the OS FS to have teh smarts to auto-trim...not sure if this requires any sort of enhanced device driver functionality, but perhaps worth looking over to see if we could port it?

Here is a link to the fstrim man page => http://man7.org/linux/man-pages/man8/fstrim.8.html

Dave Yeo:
The question is how many file systems the hardware understands. Likely FAT(32) and perhaps NTFS but doubtfully JFS or HPFS. As when files are deleted, usually just the directory entry is changed, the hardware can't know if a block is used or not unless it understands the file system. I think the hardware would also understand a zeroed out block to be empty and perhaps work like a sparse file (I once saved a multi megabyte file to a 140 kb floppy, it worked as the file was mostly empty)
The fstrim command looks interesting, the fact that it works on mounted file systems means it knows what blocks are used and it should work on OS/2 JFS. Once again backups are required in case of the Linux JFS not quite being compatible to the OS/2 JFS.

Remy:
Yes, it seems fstrim could be best option.

About SSD, most have "ssd garbage collection" but it doesn't work very well while trim or fstrim should allow full SSD speed for long time.

Navigation

[0] Message Index

[#] Next page

Go to full version