Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2015 14:31:44 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r277701 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201501251431.t0PEViKJ099110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501251431.t0PEViKJ099110>