]> git.proxmox.com Git - mirror_spl.git/commitdiff
Set TASKQ_DYNAMIC for kmem and system taskqs
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Jun 2015 16:53:47 +0000 (09:53 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Jun 2015 22:14:25 +0000 (15:14 -0700)
Add the TASKQ_DYNAMIC flag to the kmem_cache and system taskqs
to reduce the number of idle threads on the system.  Additional
threads will be created on demand up to the previous maximum
thread counts.  This should have minimal, if any, impact on
performance.

This makes the system taskq consistent with illumos which is
always created as a dynamic taskq with up to 64 threads.

The task limits for the kmem_cache have been increased to avoid
any unnessisary throttling and to keep a larger reserve of
task_t structures on the free list.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #458

module/spl/spl-kmem-cache.c
module/spl/spl-taskq.c

index cd3e543ba08ebed0e3d75c13f38d9d558b9fe8f3..86c26ff05436e2ef8e25599052c78391d5b57438 100644 (file)
@@ -1725,7 +1725,9 @@ spl_kmem_cache_init(void)
        init_rwsem(&spl_kmem_cache_sem);
        INIT_LIST_HEAD(&spl_kmem_cache_list);
        spl_kmem_cache_taskq = taskq_create("spl_kmem_cache",
-           spl_kmem_cache_kmem_threads, maxclsyspri, 1, 32, TASKQ_PREPOPULATE);
+           spl_kmem_cache_kmem_threads, maxclsyspri,
+           spl_kmem_cache_kmem_threads * 8, INT_MAX,
+           TASKQ_PREPOPULATE | TASKQ_DYNAMIC);
        spl_register_shrinker(&spl_kmem_cache_shrinker);
 
        return (0);
index 9cd193369c7fb8b45755bfe3666ddd652910c97d..44799de1d19360191236c5845a738e001548b7d0 100644 (file)
@@ -1069,10 +1069,8 @@ EXPORT_SYMBOL(taskq_destroy);
 int
 spl_taskq_init(void)
 {
-       /* Solaris creates a dynamic taskq of up to 64 threads, however in
-        * a Linux environment 1 thread per-core is usually about right */
-       system_taskq = taskq_create("spl_system_taskq", num_online_cpus(),
-                                   minclsyspri, 4, 512, TASKQ_PREPOPULATE);
+       system_taskq = taskq_create("spl_system_taskq", MAX(boot_ncpus, 64),
+           minclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC);
        if (system_taskq == NULL)
                return (1);