Write issue taskq shouldn't be dynamic

This is as much an upstream compatibility as it's a bit of a performance
gain.

The illumos taskq implemention doesn't allow a TASKQ_THREADS_CPU_PCT type
to be dynamic and in fact enforces as much with an ASSERT.

As to performance, if this taskq is dynamic, it can cause excessive
contention on tq_lock as the threads are created and destroyed because it
can see bursts of many thousands of tasks in a short time, particularly
in heavy high-concurrency zvol write workloads.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #5236
This commit is contained in:
Tim Chase 2016-10-10 17:19:14 -05:00 committed by Brian Behlendorf
parent cbf8713874
commit 4c83fa9b87
1 changed files with 2 additions and 1 deletions

View File

@ -845,7 +845,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
uint_t count = ztip->zti_count; uint_t count = ztip->zti_count;
spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q]; spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
char name[32]; char name[32];
uint_t i, flags = TASKQ_DYNAMIC; uint_t i, flags = 0;
boolean_t batch = B_FALSE; boolean_t batch = B_FALSE;
if (mode == ZTI_MODE_NULL) { if (mode == ZTI_MODE_NULL) {
@ -863,6 +863,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
case ZTI_MODE_FIXED: case ZTI_MODE_FIXED:
ASSERT3U(value, >=, 1); ASSERT3U(value, >=, 1);
value = MAX(value, 1); value = MAX(value, 1);
flags |= TASKQ_DYNAMIC;
break; break;
case ZTI_MODE_BATCH: case ZTI_MODE_BATCH: