svn commit: r346128 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Thu Apr 11 13:19:27 UTC 2019


Author: mav
Date: Thu Apr 11 13:19:26 2019
New Revision: 346128
URL: https://svnweb.freebsd.org/changeset/base/346128

Log:
  MFC r344934, r345014: Add separate aggregation limit for non-rotating media.
  
  Before sequential scrub patches ZFS never aggregated I/Os above 128KB.
  Sequential scrub bumped that to 1MB, which motivation I understand for
  spinning disks, since it should reduce number of head seeks.  But for
  SSDs it makes much less sense to me, especially on FreeBSD, where due
  to MAXPHYS limitation device will likely still see bunch of 128KB I/Os
  instead of one large.  Having more strict aggregation limit allows to
  avoid allocation of large memory buffer and memcpy to/from it, that is
  a serious problem when bandwidth reaches few GB/s.
  
  Sponsored by:	iXsystems, Inc.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Thu Apr 11 13:18:09 2019	(r346127)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Thu Apr 11 13:19:26 2019	(r346128)
@@ -178,6 +178,7 @@ int zfs_vdev_async_write_active_max_dirty_percent = 60
  * they aren't able to help us aggregate at this level.
  */
 int zfs_vdev_aggregation_limit = 1 << 20;
+int zfs_vdev_aggregation_limit_non_rotating = SPA_OLD_MAXBLOCKSIZE;
 int zfs_vdev_read_gap_limit = 32 << 10;
 int zfs_vdev_write_gap_limit = 4 << 10;
 
@@ -262,6 +263,9 @@ ZFS_VDEV_QUEUE_KNOB_MAX(initializing);
 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, aggregation_limit, CTLFLAG_RWTUN,
     &zfs_vdev_aggregation_limit, 0,
     "I/O requests are aggregated up to this size");
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, aggregation_limit_non_rotating, CTLFLAG_RWTUN,
+    &zfs_vdev_aggregation_limit_non_rotating, 0,
+    "I/O requests are aggregated up to this size for non-rotating media");
 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, read_gap_limit, CTLFLAG_RWTUN,
     &zfs_vdev_read_gap_limit, 0,
     "Acceptable gap between two reads being aggregated");
@@ -682,7 +686,11 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
 	ASSERT(MUTEX_HELD(&vq->vq_lock));
 
 	maxblocksize = spa_maxblocksize(vq->vq_vdev->vdev_spa);
-	limit = MAX(MIN(zfs_vdev_aggregation_limit, maxblocksize), 0);
+	if (vq->vq_vdev->vdev_rotation_rate == VDEV_RATE_NON_ROTATING)
+		limit = zfs_vdev_aggregation_limit_non_rotating;
+	else
+		limit = zfs_vdev_aggregation_limit;
+	limit = MAX(MIN(limit, maxblocksize), 0);
 
 	if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE || limit == 0)
 		return (NULL);


More information about the svn-src-all mailing list