aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib/libzpool
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2012-09-23 19:40:58 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2012-09-23 19:40:58 +0000
commitbcb77be2b7972fa2935bccf5a3eaa8365ac25f5e (patch)
tree85c57e3b0f3bd89091304524a42b74d8be588cd6 /cddl/lib/libzpool
parentdba466c34451153f8d8661bf76f1fab3e4cc1bd7 (diff)
downloadsrc-bcb77be2b7972fa2935bccf5a3eaa8365ac25f5e.tar.gz
src-bcb77be2b7972fa2935bccf5a3eaa8365ac25f5e.zip
Add TRIM support.
The code builds a map of regions that were freed. On every write the code consults the map and eventually removes ranges that were freed before, but are now overwritten. Freed blocks are not TRIMed immediately. There is a tunable that defines how many txg we should wait with TRIMming freed blocks (64 by default). There is a low priority thread that TRIMs ranges when the time comes. During TRIM we keep in-flight ranges on a list to detect colliding writes - we have to delay writes that collide with in-flight TRIMs in case something will be reordered and write will reached the disk before the TRIM. We don't have to do the same for in-flight writes, as colliding writes just remove ranges to TRIM. Sponsored by: multiplay.co.uk This work includes some important fixes and some improvements obtained from the zfsonlinux project, including TRIMming entire vdevs on pool create/add/attach and on pool import for spare and cache vdevs. Obtained from: zfsonlinux Submitted by: Etienne Dechamps <etienne.dechamps@ovh.net>
Notes
Notes: svn path=/head/; revision=240868
Diffstat (limited to 'cddl/lib/libzpool')
-rw-r--r--cddl/lib/libzpool/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index 417c1ccb1d60..b159d3af7311 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -26,7 +26,7 @@ ATOMIC_SRCS= opensolaris_atomic.c
LIB= zpool
-ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c
+ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c trim_map.c
ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
KERNEL_SRCS= kernel.c taskq.c util.c
LIST_SRCS= list.c