On Tue, Apr 20, 2010 at 10:45 PM, Eric Sandeen <sandeen@redhat.com> wrote:
Eric,
I don't know what kernel APIs have been created to support discard,
but the ATA8 draft spec. allows for specifying multiple ranges in one
trim command.
See section 7.10.3.1 and .2 of the latest draft spec.
Both talk about multiple trim ranges per trim command (think thousands
of ranges per command).
Recent hdparm versions accept a trim command argument that causes
multiple ranges to be trimmed per command.
--trim-sector-ranges Tell SSD firmware to discard unneeded
data sectors: lba:count ..
--trim-sector-ranges-stdin Same as above, but reads lba:count pairs from stdin
As I understand it, this is critical from a performance perspective
for the SSDs Mark tested with. ie. He found a single trim command
with 1000 ranges takes much less time than 1000 discrete trim
commands.
Per Mark's comment's in wiper.sh, a trim command can have a minimum of
128KB of associated range information, so it is thousands of ranges
that can be discarded in a single command
ie. hdparm can accept extremely large lists of ranges on stdin, but it
parses the list into discrete trim commands with thousands of ranges
per command.
A kernel implementation which is trying to implement after that fact
discards as this patch is doing, also needs to somehow craft trim
commands with a large payload of ranges if it is going to be
efficient.
If the block layer cannot do this yet, then in my opinion this type of
batched discarding needs to stay in user space as done with Mark's
wiper.sh script and enhanced hdparm until the block layer grows that
ability.
Greg
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html