svn commit: r277701 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Alexander Motin
mav at FreeBSD.org
Sun Jan 25 14:31:45 UTC 2015
Author: mav
Date: Sun Jan 25 14:31:44 2015
New Revision: 277701
URL: https://svnweb.freebsd.org/changeset/base/277701
Log:
MFC r276983: When aggregating TRIM segments, move the new one to the end.
New segment at the list head may block all TRIM requests until txg of that
segment can be processed. On my random I/O tests this change reduce peak
TRIM list length from 650 to 450 segments. Hopefully it should reduce TRIM
burstiness when list processing is unblocked.
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Sun Jan 25 14:29:40 2015 (r277700)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Sun Jan 25 14:31:44 2015 (r277701)
@@ -253,17 +253,23 @@ trim_map_segment_add(trim_map_t *tm, uin
ts_after->ts_start = ts_before->ts_start;
ts_after->ts_txg = txg;
ts_after->ts_time = time;
+ list_remove(&tm->tm_head, ts_after);
+ list_insert_tail(&tm->tm_head, ts_after);
kmem_free(ts_before, sizeof (*ts_before));
} else if (merge_before) {
TRIM_MAP_SINC(tm, end - ts_before->ts_end);
ts_before->ts_end = end;
ts_before->ts_txg = txg;
ts_before->ts_time = time;
+ list_remove(&tm->tm_head, ts_before);
+ list_insert_tail(&tm->tm_head, ts_before);
} else if (merge_after) {
TRIM_MAP_SINC(tm, ts_after->ts_start - start);
ts_after->ts_start = start;
ts_after->ts_txg = txg;
ts_after->ts_time = time;
+ list_remove(&tm->tm_head, ts_after);
+ list_insert_tail(&tm->tm_head, ts_after);
} else {
TRIM_MAP_SINC(tm, end - start);
TRIM_MAP_QINC(tm);
More information about the svn-src-stable
mailing list