svn commit: r277880 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Alexander Motin
mav at FreeBSD.org
Thu Jan 29 16:16:21 UTC 2015
Author: mav
Date: Thu Jan 29 16:16:20 2015
New Revision: 277880
URL: https://svnweb.freebsd.org/changeset/base/277880
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/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
Directory Properties:
stable/9/ (props changed)
stable/9/sys/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Jan 29 15:35:55 2015 (r277879)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Jan 29 16:16:20 2015 (r277880)
@@ -255,17 +255,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