diff options
-rw-r--r-- | uts/common/fs/zfs/sys/vdev_impl.h | 3 | ||||
-rw-r--r-- | uts/common/fs/zfs/sys/zio.h | 2 | ||||
-rw-r--r-- | uts/common/fs/zfs/vdev.c | 8 | ||||
-rw-r--r-- | uts/common/fs/zfs/vdev_queue.c | 12 |
4 files changed, 13 insertions, 12 deletions
diff --git a/uts/common/fs/zfs/sys/vdev_impl.h b/uts/common/fs/zfs/sys/vdev_impl.h index 95b8f9b..b7215e7 100644 --- a/uts/common/fs/zfs/sys/vdev_impl.h +++ b/uts/common/fs/zfs/sys/vdev_impl.h @@ -104,8 +104,7 @@ struct vdev_queue { avl_tree_t vq_read_tree; avl_tree_t vq_write_tree; avl_tree_t vq_pending_tree; - uint64_t vq_io_complete_ts; - uint64_t vq_io_delta_ts; + hrtime_t vq_io_complete_ts; kmutex_t vq_lock; }; diff --git a/uts/common/fs/zfs/sys/zio.h b/uts/common/fs/zfs/sys/zio.h index ebbd4f8..1ce087e 100644 --- a/uts/common/fs/zfs/sys/zio.h +++ b/uts/common/fs/zfs/sys/zio.h @@ -408,7 +408,7 @@ struct zio { uint64_t io_offset; uint64_t io_deadline; - uint64_t io_timestamp; + hrtime_t io_timestamp; avl_node_t io_offset_node; avl_node_t io_deadline_node; avl_tree_t *io_vdev_tree; diff --git a/uts/common/fs/zfs/vdev.c b/uts/common/fs/zfs/vdev.c index 0c7f794..cc3594a 100644 --- a/uts/common/fs/zfs/vdev.c +++ b/uts/common/fs/zfs/vdev.c @@ -3180,10 +3180,10 @@ vdev_deadman(vdev_t *vd) * the spa_deadman_synctime we panic the system. */ fio = avl_first(&vq->vq_pending_tree); - delta = ddi_get_lbolt64() - fio->io_timestamp; - if (delta > NSEC_TO_TICK(spa_deadman_synctime(spa))) { - zfs_dbgmsg("SLOW IO: zio timestamp %llu, " - "delta %llu, last io %llu", + delta = gethrtime() - fio->io_timestamp; + if (delta > spa_deadman_synctime(spa)) { + zfs_dbgmsg("SLOW IO: zio timestamp %lluns, " + "delta %lluns, last io %lluns", fio->io_timestamp, delta, vq->vq_io_complete_ts); fm_panic("I/O to pool '%s' appears to be " diff --git a/uts/common/fs/zfs/vdev_queue.c b/uts/common/fs/zfs/vdev_queue.c index a806e93..61fc177 100644 --- a/uts/common/fs/zfs/vdev_queue.c +++ b/uts/common/fs/zfs/vdev_queue.c @@ -45,8 +45,11 @@ int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; -/* deadline = pri + ddi_get_lbolt64() >> time_shift) */ -int zfs_vdev_time_shift = 6; +/* + * The deadlines are grouped into buckets based on zfs_vdev_time_shift: + * deadline = pri + gethrtime() >> time_shift) + */ +int zfs_vdev_time_shift = 29; /* each bucket is 0.537 seconds */ /* exponential I/O issue ramp-up rate */ int zfs_vdev_ramp_rate = 2; @@ -412,7 +415,7 @@ vdev_queue_io(zio_t *zio) mutex_enter(&vq->vq_lock); - zio->io_timestamp = ddi_get_lbolt64(); + zio->io_timestamp = gethrtime(); zio->io_deadline = (zio->io_timestamp >> zfs_vdev_time_shift) + zio->io_priority; @@ -445,8 +448,7 @@ vdev_queue_io_done(zio_t *zio) vdev_queue_pending_remove(vq, zio); - vq->vq_io_complete_ts = ddi_get_lbolt64(); - vq->vq_io_delta_ts = vq->vq_io_complete_ts - zio->io_timestamp; + vq->vq_io_complete_ts = gethrtime(); for (int i = 0; i < zfs_vdev_ramp_rate; i++) { zio_t *nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending); |