Print this page
4045 zfs write throttle & i/o scheduler performance work
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/vdev.c
          +++ new/usr/src/uts/common/fs/zfs/vdev.c
↓ open down ↓ 3249 lines elided ↑ open up ↑
3250 3250          for (int c = 0; c < vd->vdev_children; c++) {
3251 3251                  vdev_t *cvd = vd->vdev_child[c];
3252 3252  
3253 3253                  vdev_deadman(cvd);
3254 3254          }
3255 3255  
3256 3256          if (vd->vdev_ops->vdev_op_leaf) {
3257 3257                  vdev_queue_t *vq = &vd->vdev_queue;
3258 3258  
3259 3259                  mutex_enter(&vq->vq_lock);
3260      -                if (avl_numnodes(&vq->vq_pending_tree) > 0) {
     3260 +                if (avl_numnodes(&vq->vq_active_tree) > 0) {
3261 3261                          spa_t *spa = vd->vdev_spa;
3262 3262                          zio_t *fio;
3263 3263                          uint64_t delta;
3264 3264  
3265 3265                          /*
3266 3266                           * Look at the head of all the pending queues,
3267 3267                           * if any I/O has been outstanding for longer than
3268 3268                           * the spa_deadman_synctime we panic the system.
3269 3269                           */
3270      -                        fio = avl_first(&vq->vq_pending_tree);
     3270 +                        fio = avl_first(&vq->vq_active_tree);
3271 3271                          delta = gethrtime() - fio->io_timestamp;
3272 3272                          if (delta > spa_deadman_synctime(spa)) {
3273 3273                                  zfs_dbgmsg("SLOW IO: zio timestamp %lluns, "
3274 3274                                      "delta %lluns, last io %lluns",
3275 3275                                      fio->io_timestamp, delta,
3276 3276                                      vq->vq_io_complete_ts);
3277 3277                                  fm_panic("I/O to pool '%s' appears to be "
3278 3278                                      "hung.", spa_name(spa));
3279 3279                          }
3280 3280                  }
3281 3281                  mutex_exit(&vq->vq_lock);
3282 3282          }
3283 3283  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX