Mesa (master): swr: Fix KNOB_MAX_WORKER_THREADS thread creation override.

George Kyriazis gkyriazis at kemper.freedesktop.org
Wed Dec 13 20:44:35 UTC 2017


Module: Mesa
Branch: master
Commit: 709f5bdc4a2bf31f422f5cf60797224c0463c10a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=709f5bdc4a2bf31f422f5cf60797224c0463c10a

Author: Bruce Cherniak <bruce.cherniak at intel.com>
Date:   Tue Dec 12 17:18:23 2017 -0600

swr: Fix KNOB_MAX_WORKER_THREADS thread creation override.

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 at lists.freedesktop.org>

Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com>

---

 src/gallium/drivers/swr/rasterizer/core/threads.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
index f4ddc21226..6242cb3fc7 100644
--- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
@@ -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();
         }
     }
 




More information about the mesa-commit mailing list