From 3dfb57a35e8cbaa7c424611235d669f3c575ada1 Mon Sep 17 00:00:00 2001 From: Don Brady Date: Thu, 13 Oct 2016 18:59:18 -0600 Subject: OpenZFS 7090 - zfs should throttle allocations OpenZFS 7090 - zfs should throttle allocations Authored by: George Wilson Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Prakash Surya Reviewed by: Sebastien Roy Approved by: Matthew Ahrens Ported-by: Don Brady Reviewed-by: Brian Behlendorf When write I/Os are issued, they are issued in block order but the ZIO pipeline will drive them asynchronously through the allocation stage which can result in blocks being allocated out-of-order. It would be nice to preserve as much of the logical order as possible. In addition, the allocations are equally scattered across all top-level VDEVs but not all top-level VDEVs are created equally. The pipeline should be able to detect devices that are more capable of handling allocations and should allocate more blocks to those devices. This allows for dynamic allocation distribution when devices are imbalanced as fuller devices will tend to be slower than empty devices. The change includes a new pool-wide allocation queue which would throttle and order allocations in the ZIO pipeline. The queue would be ordered by issued time and offset and would provide an initial amount of allocation of work to each top-level vdev. The allocation logic utilizes a reservation system to reserve allocations that will be performed by the allocator. Once an allocation is successfully completed it's scheduled on a given top-level vdev. Each top-level vdev maintains a maximum number of allocations that it can handle (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels * mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab groups and round robin across all eligible metaslab groups to distribute the work. As top-levels complete their work, they receive additional work from the pool-wide allocation queue until the allocation queue is emptied. OpenZFS-issue: https://www.illumos.org/issues/7090 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/4756c3d7 Closes #5258 Porting Notes: - Maintained minimal stack in zio_done - Preserve linux-specific io sizes in zio_write_compress - Added module params and documentation - Updated to use optimize AVL cmp macros --- man/man5/zfs-module-parameters.5 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'man') diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index e24716014..932342cfd 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -1097,6 +1097,18 @@ See the section "ZFS I/O SCHEDULER". Default value: \fB10\fR. .RE +.sp +.ne 2 +.na +\fBzfs_vdev_queue_depth_pct\fR (int) +.ad +.RS 12n +The queue depth percentage for each top-level virtual device. +Used in conjunction with zfs_vdev_async_max_active. +.sp +Default value: \fB1000\fR. +.RE + .sp .ne 2 .na @@ -1840,6 +1852,18 @@ operations. Default value: \fB30,000\fR. .RE +.sp +.ne 2 +.na +\fBzio_dva_throttle_enabled\fR (int) +.ad +.RS 12n +Throttle block allocations in the ZIO pipeline. This allows for +dynamic allocation distribution when devices are imbalanced. +.sp +Default value: \fB1\fR. +.RE + .sp .ne 2 .na -- cgit v1.2.3