aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2009-12-28 20:08:01 +0000
committerAlexander Motin <mav@FreeBSD.org>2009-12-28 20:08:01 +0000
commit1c80ec0a6b2fd66a0cfb314a5f0e5820de87ade0 (patch)
tree19ac67f810c8b99485f8cc69f04ff987d83ce637 /sys/geom
parenta4660d594f0f1d4687fd71750af95bd7b61c679e (diff)
downloadsrc-1c80ec0a6b2fd66a0cfb314a5f0e5820de87ade0.tar.gz
src-1c80ec0a6b2fd66a0cfb314a5f0e5820de87ade0.zip
Add BIO_DELETE support to ada(4):
- For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by ACS-2 specification working draft. - For CompactFlash use CFA ERASE command, same as ad(4) does. With this patch, `newfs -E /dev/ada1` was able to restore write speed of my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level for the most part of it's capacity. Previous 1.3 firmware, even reportiong TRIM capabilty bit set, was not working, reporting ABORT error for every DSM command. I have no idea whether it is normal, but for some reason it takes 200ms to handle any TRIM command on this drive, that was making delete extremely slow. But TRIM command is able to accept long list of LBAs and the length of that list seems doesn't affect it's execution time. Implemented request clusting algorithm allowed me to rise delete rate up to reasonable numbers, when many parallel DELETE requests running.
Notes
Notes: svn path=/head/; revision=201139
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index af05618f163b..b2d9d3b94fb5 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -299,8 +299,8 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
}
while (length > 0) {
chunk = length;
- if (chunk > 1024 * cp->provider->sectorsize)
- chunk = 1024 * cp->provider->sectorsize;
+ if (chunk > 65536 * cp->provider->sectorsize)
+ chunk = 65536 * cp->provider->sectorsize;
error = g_delete_data(cp, offset, chunk);
length -= chunk;
offset += chunk;