Thread (54 messages) 54 messages, 19 authors, 2009-08-17

Re: Discard support (was Re: [PATCH] swap: send callback when swap slot is freed)

From: Chris Worley <hidden>
Date: 2009-08-14 23:21:34
Also in: linux-ide, linux-mm, linux-scsi, lkml

On Fri, Aug 14, 2009 at 4:10 PM, Mark Lord[off-list ref] wrote:
Bryan Donlan wrote:
..
quoted
Perhaps an interface (ioctl, etc) can be added to ask a filesystem to
discard all unused blocks in a certain range? (That is, have the
filesystem validate the request under any necessary locks before
passing it to the block IO layer)
..

While possibly TRIM-specific, this approach has the lowest overhead
and probably the greatest gain-for-pain ratio.

But it may not be as nice for enterprise (?).

On the Indilinx-based SSDs (eg. OCZ Vertex), TRIM seems to trigger an
internal garbage-collection/erase cycle.  As such, the drive really prefers
a few LARGE trim lists, rather than many smaller ones.

Here's some information that a vendor has observed from the Win7 use of
TRIM:
quoted
TRIM command is sent:
-       About 2/3 of partition is filled up, when file is deleted.
       (I am not talking about send file to trash bin.)
-       In the above case, when trash bin gets emptied.
-       In the above case, when partition is deleted.

TRIM command is not sent:-
-       When file is moved to trash bin
-       When partition is formatted. (Both quick and full format)
-       When empty partition is deleted
-       When file is deleted while there is big remaining free space
..

His words, not mine.  But the idea seems to be to batch them in large
chunks.
Sooner is better than waiting to coalesce.  The longer an LBA is
inactive, the better for any management scheme.  If you wait until
it's reused, you might as well forgo the advantages of TRIM/UNMAP.  If
a the controller wants to coalesce, let it coalesce.

Chris
My wiper.sh "trim script" is packaged with the latest hdparm (currently
9.24)
on sourceforge, for those who want to try this stuff for real.  No special
kernel support is required to use it.

Cheers

Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help