summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-08-02 04:01:44 +0000
committerdelphij <delphij@FreeBSD.org>2014-08-02 04:01:44 +0000
commit2f2875361e19bf1fdf4fde5c8e1763dcc4190620 (patch)
tree6ad33d201a6ec72b3227e7189157d71363c85e0c /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
parentb798cd9bfe5eed52bd7d48badb239999a0d81389 (diff)
downloadFreeBSD-src-2f2875361e19bf1fdf4fde5c8e1763dcc4190620.zip
FreeBSD-src-2f2875361e19bf1fdf4fde5c8e1763dcc4190620.tar.gz
MFC r268859: MFV r268851:
When a sync task is waiting for a txg to complete, we should hurry it along by increasing the number of outstanding async writes (i.e. make vdev_queue_max_async_writes() return a larger number). Illumos issue: 4753 increase number of outstanding async writes when sync task is waiting
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
index 11f05a0..c62c97d 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -408,14 +408,23 @@ vdev_queue_class_min_active(zio_priority_t p)
}
static int
-vdev_queue_max_async_writes(uint64_t dirty)
+vdev_queue_max_async_writes(spa_t *spa)
{
int writes;
+ uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total;
uint64_t min_bytes = zfs_dirty_data_max *
zfs_vdev_async_write_active_min_dirty_percent / 100;
uint64_t max_bytes = zfs_dirty_data_max *
zfs_vdev_async_write_active_max_dirty_percent / 100;
+ /*
+ * Sync tasks correspond to interactive user actions. To reduce the
+ * execution time of those actions we push data out as fast as possible.
+ */
+ if (spa_has_pending_synctask(spa)) {
+ return (zfs_vdev_async_write_max_active);
+ }
+
if (dirty < min_bytes)
return (zfs_vdev_async_write_min_active);
if (dirty > max_bytes)
@@ -448,8 +457,7 @@ vdev_queue_class_max_active(spa_t *spa, zio_priority_t p)
case ZIO_PRIORITY_ASYNC_READ:
return (zfs_vdev_async_read_max_active);
case ZIO_PRIORITY_ASYNC_WRITE:
- return (vdev_queue_max_async_writes(
- spa->spa_dsl_pool->dp_dirty_total));
+ return (vdev_queue_max_async_writes(spa));
case ZIO_PRIORITY_SCRUB:
return (zfs_vdev_scrub_max_active);
default:
OpenPOWER on IntegriCloud