summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Oliver Stöneberg <oliverst@online.de>2015-01-07 23:41:03 +0100
committer Oliver Stöneberg <oliverst@online.de>2015-01-07 23:41:03 +0100
commit269035ff03b6f2af3e93ec5bdd4a32814eb7eef7 (patch)
tree2040923d56c3ea483e1db1058e4b3507cc124e66
parentcbd526ed791c1e9ffece977a1032ad991ee14320 (diff)
osd_work: default back to numproc-1 threads for WORK_QUEUE_FLAG_MULTI (nw)
-rw-r--r--src/osd/modules/sync/work_osd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osd/modules/sync/work_osd.c b/src/osd/modules/sync/work_osd.c
index 8a337cb7ff1..cb48614b229 100644
--- a/src/osd/modules/sync/work_osd.c
+++ b/src/osd/modules/sync/work_osd.c
@@ -207,9 +207,9 @@ osd_work_queue *osd_work_queue_alloc(int flags)
// on a single-CPU system, create 1 thread for I/O queues, and 0 threads for everything else
if (numprocs == 1)
threadnum = (flags & WORK_QUEUE_FLAG_IO) ? 1 : 0;
- // on an n-CPU system, create n threads for multi queues, and 1 thread for everything else
+ // on an n-CPU system, create n-1 threads for multi queues, and 1 thread for everything else
else
- threadnum = (flags & WORK_QUEUE_FLAG_MULTI) ? numprocs : 1;
+ threadnum = (flags & WORK_QUEUE_FLAG_MULTI) ? (numprocs - 1) : 1;
if (osdworkqueuemaxthreads != NULL && sscanf(osdworkqueuemaxthreads, "%d", &osdthreadnum) == 1 && threadnum > osdthreadnum)
threadnum = osdthreadnum;