summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/vdev_queue.c
diff options
context:
space:
mode:
authorJeff Bonwick <Jeff.Bonwick@Sun.COM>2008-09-29 18:13:58 -0700
committerJeff Bonwick <Jeff.Bonwick@Sun.COM>2008-09-29 18:13:58 -0700
commite14bb3258d05c1b1077e2db7cf77088924e56919 (patch)
treeb06f57c22470aae809012a77810af477fb8a484d /usr/src/uts/common/fs/zfs/vdev_queue.c
parentd0fa49b78d1f40d84ec76c363cdc38cf128511dd (diff)
downloadillumos-gate-e14bb3258d05c1b1077e2db7cf77088924e56919.tar.gz
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
6667208 zfs/zpool commands on failed pool should not hang 6430480 grabbing config lock as writer during I/O load can take excessively long
Diffstat (limited to 'usr/src/uts/common/fs/zfs/vdev_queue.c')
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_queue.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev_queue.c b/usr/src/uts/common/fs/zfs/vdev_queue.c
index 0f921e088a..46fca0e3b6 100644
--- a/usr/src/uts/common/fs/zfs/vdev_queue.c
+++ b/usr/src/uts/common/fs/zfs/vdev_queue.c
@@ -19,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/zfs_context.h>
#include <sys/spa.h>
#include <sys/vdev_impl.h>
@@ -191,6 +189,7 @@ vdev_queue_io_to_issue(vdev_queue_t *vq, uint64_t pending_limit)
size = fio->io_size;
while ((dio = AVL_PREV(tree, fio)) != NULL && IS_ADJACENT(dio, fio) &&
+ !((dio->io_flags | fio->io_flags) & ZIO_FLAG_DONT_AGGREGATE) &&
size + dio->io_size <= zfs_vdev_aggregation_limit) {
dio->io_delegate_next = fio;
fio = dio;
@@ -198,6 +197,7 @@ vdev_queue_io_to_issue(vdev_queue_t *vq, uint64_t pending_limit)
}
while ((dio = AVL_NEXT(tree, lio)) != NULL && IS_ADJACENT(lio, dio) &&
+ !((lio->io_flags | dio->io_flags) & ZIO_FLAG_DONT_AGGREGATE) &&
size + dio->io_size <= zfs_vdev_aggregation_limit) {
lio->io_delegate_next = dio;
lio = dio;
@@ -207,15 +207,12 @@ vdev_queue_io_to_issue(vdev_queue_t *vq, uint64_t pending_limit)
if (fio != lio) {
char *buf = zio_buf_alloc(size);
uint64_t offset = 0;
- int nagg = 0;
ASSERT(size <= zfs_vdev_aggregation_limit);
- aio = zio_vdev_child_io(fio, NULL, fio->io_vd,
- fio->io_offset, buf, size, fio->io_type,
- ZIO_PRIORITY_NOW, ZIO_FLAG_DONT_QUEUE |
- ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_PROPAGATE |
- ZIO_FLAG_NOBOOKMARK,
+ aio = zio_vdev_delegated_io(fio->io_vd, fio->io_offset,
+ buf, size, fio->io_type, ZIO_PRIORITY_NOW,
+ ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE,
vdev_queue_agg_io_done, NULL);
aio->io_delegate_list = fio;
@@ -228,16 +225,10 @@ vdev_queue_io_to_issue(vdev_queue_t *vq, uint64_t pending_limit)
offset += dio->io_size;
vdev_queue_io_remove(vq, dio);
zio_vdev_io_bypass(dio);
- nagg++;
}
ASSERT(offset == size);
- dprintf("%5s T=%llu off=%8llx agg=%3d "
- "old=%5llx new=%5llx\n",
- zio_type_name[fio->io_type],
- fio->io_deadline, fio->io_offset, nagg, fio->io_size, size);
-
avl_add(&vq->vq_pending_tree, aio);
return (aio);
@@ -271,8 +262,7 @@ vdev_queue_io(zio_t *zio)
mutex_enter(&vq->vq_lock);
- zio->io_deadline = (zio->io_timestamp >> zfs_vdev_time_shift) +
- zio->io_priority;
+ zio->io_deadline = (lbolt64 >> zfs_vdev_time_shift) + zio->io_priority;
vdev_queue_io_add(vq, zio);
@@ -295,15 +285,13 @@ void
vdev_queue_io_done(zio_t *zio)
{
vdev_queue_t *vq = &zio->io_vd->vdev_queue;
- zio_t *nio;
- int i;
mutex_enter(&vq->vq_lock);
avl_remove(&vq->vq_pending_tree, zio);
- for (i = 0; i < zfs_vdev_ramp_rate; i++) {
- nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending);
+ for (int i = 0; i < zfs_vdev_ramp_rate; i++) {
+ zio_t *nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending);
if (nio == NULL)
break;
mutex_exit(&vq->vq_lock);