aboutsummaryrefslogtreecommitdiffstats
path: root/module/spl/spl-taskq.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-07-23 11:21:08 -0700
committerBrian Behlendorf <[email protected]>2015-07-23 13:25:49 -0700
commit62aa81a5776c0bc35f05f8923ea3e293527b5264 (patch)
tree106eee836ad350cbe2e5c0919af68a6ba3360870 /module/spl/spl-taskq.c
parent9eb361aaa537724c9a90ab6a9f33521bfd80bad9 (diff)
Add defclsyspri macro
Add a new defclsyspri macro which can be used to request the default Linux scheduler priority. Neither the minclsyspri or maxclsyspri map to the default Linux kernel thread priority. This makes it awkward to create taskqs which run with the same priority as the rest of the kernel threads on the system which can lead to performance issues. All SPL callers which previously used minclsyspri or maxclsyspri have been changed to use defclsyspri. The vast majority of callers were part of the test suite which won't have an external impact. The few places where it could impact performance the change was from maxclsyspri to defclsyspri. This makes it more likely the process will be scheduled which may help performance. To facilitate further performance analysis the spl_taskq_thread_priority module option has been added. When disabled (0) all newly created kernel threads will use the default kernel thread priority. When enabled (1) the specified taskq priority will be used. By default this value is enabled (1). Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/spl/spl-taskq.c')
-rw-r--r--module/spl/spl-taskq.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c
index 44799de1d..b4282333e 100644
--- a/module/spl/spl-taskq.c
+++ b/module/spl/spl-taskq.c
@@ -36,6 +36,11 @@ int spl_taskq_thread_dynamic = 1;
module_param(spl_taskq_thread_dynamic, int, 0644);
MODULE_PARM_DESC(spl_taskq_thread_dynamic, "Allow dynamic taskq threads");
+int spl_taskq_thread_priority = 1;
+module_param(spl_taskq_thread_priority, int, 0644);
+MODULE_PARM_DESC(spl_taskq_thread_priority,
+ "Allow non-default priority for taskq threads");
+
int spl_taskq_thread_sequential = 4;
module_param(spl_taskq_thread_sequential, int, 0644);
MODULE_PARM_DESC(spl_taskq_thread_sequential,
@@ -913,7 +918,9 @@ taskq_thread_create(taskq_t *tq)
kthread_bind(tqt->tqt_thread, last_used_cpu);
}
- set_user_nice(tqt->tqt_thread, PRIO_TO_NICE(tq->tq_pri));
+ if (spl_taskq_thread_priority)
+ set_user_nice(tqt->tqt_thread, PRIO_TO_NICE(tq->tq_pri));
+
wake_up_process(tqt->tqt_thread);
return (tqt);
@@ -1070,12 +1077,12 @@ int
spl_taskq_init(void)
{
system_taskq = taskq_create("spl_system_taskq", MAX(boot_ncpus, 64),
- minclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC);
+ defclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC);
if (system_taskq == NULL)
return (1);
dynamic_taskq = taskq_create("spl_dynamic_taskq", 1,
- minclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE);
+ defclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE);
if (dynamic_taskq == NULL) {
taskq_destroy(system_taskq);
return (1);