swr: Fix KNOB_MAX_WORKER_THREADS thread creation override.
authorBruce Cherniak <bruce.cherniak@intel.com>
Tue, 12 Dec 2017 23:18:23 +0000 (17:18 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Wed, 13 Dec 2017 20:44:01 +0000 (14:44 -0600)
Environment variable KNOB_MAX_WORKER_THREADS allows the user to override
default thread creation and thread binding.  Previous commit to adjust
linux cpu topology caused setting this KNOB to bind all threads to a single
core.

This patch restores correct functionality of override.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/core/threads.cpp

index f4ddc212264873845e61cd3ca589ef5c9f3f988b..6242cb3fc7cab9cbab4e75ef3472963aea7a5543 100644 (file)
@@ -213,8 +213,7 @@ void CalculateProcessorTopology(CPUNumaNodes& out_nodes, uint32_t& out_numThread
     {
         for (auto &core : node.cores)
         {
-            out_numThreadsPerProcGroup = std::max((size_t)out_numThreadsPerProcGroup,
-                                                  core.threadIds.size());
+            out_numThreadsPerProcGroup += core.threadIds.size();
         }
     }