aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/sys/sysmacros.h1
-rw-r--r--include/sys/taskq.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index 4838ab3be..9f16ac70f 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -95,6 +95,7 @@
*/
#define minclsyspri (MAX_RT_PRIO)
#define maxclsyspri (MAX_PRIO-1)
+#define defclsyspri (DEFAULT_PRIO)
#ifndef NICE_TO_PRIO
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
diff --git a/include/sys/taskq.h b/include/sys/taskq.h
index a43a86da6..5c29e8f0e 100644
--- a/include/sys/taskq.h
+++ b/include/sys/taskq.h
@@ -129,7 +129,7 @@ extern int taskq_member(taskq_t *, void *);
#define taskq_create_proc(name, nthreads, pri, min, max, proc, flags) \
taskq_create(name, nthreads, pri, min, max, flags)
#define taskq_create_sysdc(name, nthreads, min, max, proc, dc, flags) \
- taskq_create(name, nthreads, maxclsyspri, min, max, flags)
+ taskq_create(name, nthreads, defclsyspri, min, max, flags)
int spl_taskq_init(void);
void spl_taskq_fini(void);