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>


3240         if (pvd->vdev_children == 1) {
3241                 vdev_remove_parent(cvd);
3242                 cvd->vdev_splitting = B_TRUE;
3243         }
3244         vdev_propagate_state(cvd);
3245 }
3246 
3247 void
3248 vdev_deadman(vdev_t *vd)
3249 {
3250         for (int c = 0; c < vd->vdev_children; c++) {
3251                 vdev_t *cvd = vd->vdev_child[c];
3252 
3253                 vdev_deadman(cvd);
3254         }
3255 
3256         if (vd->vdev_ops->vdev_op_leaf) {
3257                 vdev_queue_t *vq = &vd->vdev_queue;
3258 
3259                 mutex_enter(&vq->vq_lock);
3260                 if (avl_numnodes(&vq->vq_pending_tree) > 0) {
3261                         spa_t *spa = vd->vdev_spa;
3262                         zio_t *fio;
3263                         uint64_t delta;
3264 
3265                         /*
3266                          * Look at the head of all the pending queues,
3267                          * if any I/O has been outstanding for longer than
3268                          * the spa_deadman_synctime we panic the system.
3269                          */
3270                         fio = avl_first(&vq->vq_pending_tree);
3271                         delta = gethrtime() - fio->io_timestamp;
3272                         if (delta > spa_deadman_synctime(spa)) {
3273                                 zfs_dbgmsg("SLOW IO: zio timestamp %lluns, "
3274                                     "delta %lluns, last io %lluns",
3275                                     fio->io_timestamp, delta,
3276                                     vq->vq_io_complete_ts);
3277                                 fm_panic("I/O to pool '%s' appears to be "
3278                                     "hung.", spa_name(spa));
3279                         }
3280                 }
3281                 mutex_exit(&vq->vq_lock);
3282         }
3283 }


3240         if (pvd->vdev_children == 1) {
3241                 vdev_remove_parent(cvd);
3242                 cvd->vdev_splitting = B_TRUE;
3243         }
3244         vdev_propagate_state(cvd);
3245 }
3246 
3247 void
3248 vdev_deadman(vdev_t *vd)
3249 {
3250         for (int c = 0; c < vd->vdev_children; c++) {
3251                 vdev_t *cvd = vd->vdev_child[c];
3252 
3253                 vdev_deadman(cvd);
3254         }
3255 
3256         if (vd->vdev_ops->vdev_op_leaf) {
3257                 vdev_queue_t *vq = &vd->vdev_queue;
3258 
3259                 mutex_enter(&vq->vq_lock);
3260                 if (avl_numnodes(&vq->vq_active_tree) > 0) {
3261                         spa_t *spa = vd->vdev_spa;
3262                         zio_t *fio;
3263                         uint64_t delta;
3264 
3265                         /*
3266                          * Look at the head of all the pending queues,
3267                          * if any I/O has been outstanding for longer than
3268                          * the spa_deadman_synctime we panic the system.
3269                          */
3270                         fio = avl_first(&vq->vq_active_tree);
3271                         delta = gethrtime() - fio->io_timestamp;
3272                         if (delta > spa_deadman_synctime(spa)) {
3273                                 zfs_dbgmsg("SLOW IO: zio timestamp %lluns, "
3274                                     "delta %lluns, last io %lluns",
3275                                     fio->io_timestamp, delta,
3276                                     vq->vq_io_complete_ts);
3277                                 fm_panic("I/O to pool '%s' appears to be "
3278                                     "hung.", spa_name(spa));
3279                         }
3280                 }
3281                 mutex_exit(&vq->vq_lock);
3282         }
3283 }