summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-04-14 12:20:06 +0000
committerpjd <pjd@FreeBSD.org>2007-04-14 12:20:06 +0000
commit9a4164a0bbc4132516bf079569c87cc8319b1a52 (patch)
treefa6ee78926429ede5f1aed3ee454d9368ad52d9e /sys/contrib
parentc4b43c46c906a35a302c13d4b22acc1f93e75de1 (diff)
downloadFreeBSD-src-9a4164a0bbc4132516bf079569c87cc8319b1a52.zip
FreeBSD-src-9a4164a0bbc4132516bf079569c87cc8319b1a52.tar.gz
MFp4: - Allow to tune number of spa_zio_* threads.
- Reduce default number of spa_zio_* threads to N*spa_zio_issue plus N*spa_zio_intr threads per ZIO type, where N is the number of CPUs. - Put ZIO type number in thread's name.
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/opensolaris/uts/common/fs/zfs/spa.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c
index bfaa5e7..b1ebfcb 100644
--- a/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c
+++ b/sys/contrib/opensolaris/uts/common/fs/zfs/spa.c
@@ -58,7 +58,13 @@
#include <sys/fs/zfs.h>
#include <sys/callb.h>
-int zio_taskq_threads = 8;
+int zio_taskq_threads = 0;
+SYSCTL_DECL(_vfs_zfs);
+SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO");
+TUNABLE_INT("vfs.zfs.zio.taskq_threads", &zio_taskq_threads);
+SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, taskq_threads, CTLFLAG_RW,
+ &zio_taskq_threads, 0, "Number of ZIO threads per ZIO type");
+
/*
* ==========================================================================
@@ -111,6 +117,8 @@ static void
spa_activate(spa_t *spa)
{
int t;
+ int nthreads = zio_taskq_threads;
+ char name[32];
ASSERT(spa->spa_state == POOL_STATE_UNINITIALIZED);
@@ -118,13 +126,15 @@ spa_activate(spa_t *spa)
spa->spa_normal_class = metaslab_class_create();
+ if (nthreads == 0)
+ nthreads = mp_ncpus;
for (t = 0; t < ZIO_TYPES; t++) {
- spa->spa_zio_issue_taskq[t] = taskq_create("spa_zio_issue",
- zio_taskq_threads, maxclsyspri, 50, INT_MAX,
- TASKQ_PREPOPULATE);
- spa->spa_zio_intr_taskq[t] = taskq_create("spa_zio_intr",
- zio_taskq_threads, maxclsyspri, 50, INT_MAX,
- TASKQ_PREPOPULATE);
+ snprintf(name, sizeof(name), "spa_zio_issue %d", t);
+ spa->spa_zio_issue_taskq[t] = taskq_create(name, nthreads,
+ maxclsyspri, 50, INT_MAX, TASKQ_PREPOPULATE);
+ snprintf(name, sizeof(name), "spa_zio_intr %d", t);
+ spa->spa_zio_intr_taskq[t] = taskq_create(name, nthreads,
+ maxclsyspri, 50, INT_MAX, TASKQ_PREPOPULATE);
}
rw_init(&spa->spa_traverse_lock, NULL, RW_DEFAULT, NULL);
OpenPOWER on IntegriCloud