|
24 | 24 | */
|
25 | 25 |
|
26 | 26 | /*
|
27 |
| - * Copyright (c) 2013 by Delphix. All rights reserved. |
| 27 | + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. |
28 | 28 | */
|
29 | 29 |
|
30 | 30 | #include <sys/zfs_context.h>
|
@@ -230,14 +230,23 @@ vdev_queue_class_min_active(zio_priority_t p)
|
230 | 230 | }
|
231 | 231 |
|
232 | 232 | static int
|
233 |
| -vdev_queue_max_async_writes(uint64_t dirty) |
| 233 | +vdev_queue_max_async_writes(spa_t *spa) |
234 | 234 | {
|
235 | 235 | int writes;
|
| 236 | + uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total; |
236 | 237 | uint64_t min_bytes = zfs_dirty_data_max *
|
237 | 238 | zfs_vdev_async_write_active_min_dirty_percent / 100;
|
238 | 239 | uint64_t max_bytes = zfs_dirty_data_max *
|
239 | 240 | zfs_vdev_async_write_active_max_dirty_percent / 100;
|
240 | 241 |
|
| 242 | + /* |
| 243 | + * Sync tasks correspond to interactive user actions. To reduce the |
| 244 | + * execution time of those actions we push data out as fast as possible. |
| 245 | + */ |
| 246 | + if (spa_has_pending_synctask(spa)) { |
| 247 | + return (zfs_vdev_async_write_max_active); |
| 248 | + } |
| 249 | + |
241 | 250 | if (dirty < min_bytes)
|
242 | 251 | return (zfs_vdev_async_write_min_active);
|
243 | 252 | if (dirty > max_bytes)
|
@@ -270,8 +279,7 @@ vdev_queue_class_max_active(spa_t *spa, zio_priority_t p)
|
270 | 279 | case ZIO_PRIORITY_ASYNC_READ:
|
271 | 280 | return (zfs_vdev_async_read_max_active);
|
272 | 281 | case ZIO_PRIORITY_ASYNC_WRITE:
|
273 |
| - return (vdev_queue_max_async_writes( |
274 |
| - spa->spa_dsl_pool->dp_dirty_total)); |
| 282 | + return (vdev_queue_max_async_writes(spa)); |
275 | 283 | case ZIO_PRIORITY_SCRUB:
|
276 | 284 | return (zfs_vdev_scrub_max_active);
|
277 | 285 | default:
|
|
0 commit comments