]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Make zio_taskq_batch_pct user configurable
authorDHE <git@dehacked.net>
Wed, 16 Dec 2015 19:22:32 +0000 (14:22 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 18 Dec 2015 21:46:23 +0000 (13:46 -0800)
Adds zio_taskq_batch_pct as an exported module parameter,
allowing users to modify it at module load time.

Signed-off-by: DHE <git@dehacked.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4110

man/man5/zfs-module-parameters.5
module/zfs/spa.c

index e1af27d1441ffdcf101aa2a882e28169f5cef6a2..6be382eacafe9f8d7bf67719ff54612f9e133de0 100644 (file)
@@ -1598,6 +1598,23 @@ Prioritize requeued I/O
 Default value: \fB0\fR.
 .RE
 
+.sp
+.ne 2
+.na
+\fBzio_taskq_batch_pct\fR (uint)
+.ad
+.RS 12n
+Percentage of online CPUs (or CPU cores, etc) which will run a worker thread
+for IO. These workers are responsible for IO work such as compression and
+checksum calculations. Fractional number of CPUs will be rounded down.
+.sp
+The default value of 75 was chosen to avoid using all CPUs which can result in
+latency issues and inconsistent application performance, especially when high
+compression is enabled.
+.sp
+Default value: \fB75\fR.
+.RE
+
 .sp
 .ne 2
 .na
index 2e23a341fb13119ecd98902715543e53c038834f..b4831a724c36554deb249c32391063616621d099 100644 (file)
@@ -867,7 +867,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
        case ZTI_MODE_BATCH:
                batch = B_TRUE;
                flags |= TASKQ_THREADS_CPU_PCT;
-               value = zio_taskq_batch_pct;
+               value = MIN(zio_taskq_batch_pct, 100);
                break;
 
        default:
@@ -6804,4 +6804,9 @@ MODULE_PARM_DESC(spa_load_verify_metadata,
 module_param(spa_load_verify_data, int, 0644);
 MODULE_PARM_DESC(spa_load_verify_data,
        "Set to traverse data on pool import");
+
+module_param(zio_taskq_batch_pct, uint, 0444);
+MODULE_PARM_DESC(zio_taskq_batch_pct,
+       "Percentage of CPUs to run an IO worker thread");
+
 #endif