Skip to content

Commit 1d02bde

Browse files
amotinbehlendorf
authored andcommitted
Fix for "Reduce latency effects of non-interactive I/O"
It was found that setting min_active tunables for non-interactive I/Os makes them stuck. It is caused by zfs_vdev_nia_delay, that can never be reached if we never issue any I/Os due to min_active set to zero. Fix this by issuing at least one non-interactive I/O at a time when there are no interactive I/Os. When there are interactive I/Os, zero min_active allows to completely block any non-interactive I/O. It may min_active starvation in some scenarios, but who we are to deny foot shooting? Reviewed-by: George Melikov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #11261
1 parent 2080c4f commit 1d02bde

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

module/zfs/vdev_queue.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,21 +380,21 @@ vdev_queue_class_max_active(spa_t *spa, vdev_queue_t *vq, zio_priority_t p)
380380
return (MIN(vq->vq_nia_credit,
381381
zfs_vdev_scrub_min_active));
382382
} else if (vq->vq_nia_credit < zfs_vdev_nia_delay)
383-
return (zfs_vdev_scrub_min_active);
383+
return (MAX(1, zfs_vdev_scrub_min_active));
384384
return (zfs_vdev_scrub_max_active);
385385
case ZIO_PRIORITY_REMOVAL:
386386
if (vq->vq_ia_active > 0) {
387387
return (MIN(vq->vq_nia_credit,
388388
zfs_vdev_removal_min_active));
389389
} else if (vq->vq_nia_credit < zfs_vdev_nia_delay)
390-
return (zfs_vdev_removal_min_active);
390+
return (MAX(1, zfs_vdev_removal_min_active));
391391
return (zfs_vdev_removal_max_active);
392392
case ZIO_PRIORITY_INITIALIZING:
393393
if (vq->vq_ia_active > 0) {
394394
return (MIN(vq->vq_nia_credit,
395395
zfs_vdev_initializing_min_active));
396396
} else if (vq->vq_nia_credit < zfs_vdev_nia_delay)
397-
return (zfs_vdev_initializing_min_active);
397+
return (MAX(1, zfs_vdev_initializing_min_active));
398398
return (zfs_vdev_initializing_max_active);
399399
case ZIO_PRIORITY_TRIM:
400400
return (zfs_vdev_trim_max_active);
@@ -403,7 +403,7 @@ vdev_queue_class_max_active(spa_t *spa, vdev_queue_t *vq, zio_priority_t p)
403403
return (MIN(vq->vq_nia_credit,
404404
zfs_vdev_rebuild_min_active));
405405
} else if (vq->vq_nia_credit < zfs_vdev_nia_delay)
406-
return (zfs_vdev_rebuild_min_active);
406+
return (MAX(1, zfs_vdev_rebuild_min_active));
407407
return (zfs_vdev_rebuild_max_active);
408408
default:
409409
panic("invalid priority %u", p);

0 commit comments

Comments
 (0)