osd_work: default back to numproc-1 threads for WORK_QUEUE_FLAG_MULTI (nw)

This commit is contained in:
Oliver Stöneberg 2015-01-07 23:41:03 +01:00
parent cbd526ed79
commit 269035ff03

View File

@ -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 // on a single-CPU system, create 1 thread for I/O queues, and 0 threads for everything else
if (numprocs == 1) if (numprocs == 1)
threadnum = (flags & WORK_QUEUE_FLAG_IO) ? 1 : 0; 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 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) if (osdworkqueuemaxthreads != NULL && sscanf(osdworkqueuemaxthreads, "%d", &osdthreadnum) == 1 && threadnum > osdthreadnum)
threadnum = osdthreadnum; threadnum = osdthreadnum;