[Mesa-dev] [PATCH] swr: Prune empty nodes in CalculateProcessorTopology.

Kyriazis, George george.kyriazis at intel.com
Thu Jan 19 22:47:36 UTC 2017


Bruce,

I think you have to add the cc: line in the message body, and not cc mesa-stable explicitly, as described in http://www.mesa3d.org/devinfo.html.  I could be wrong, though.

Otherwise,

Reviewed-By: George Kyriazis <george.kyriazis at intel.com>

Thanks,

George

> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On
> Behalf Of Bruce Cherniak
> Sent: Thursday, January 19, 2017 3:45 PM
> To: mesa-dev at lists.freedesktop.org; mesa-stable at lists.freedesktop.org
> Subject: [Mesa-dev] [PATCH] swr: Prune empty nodes in
> CalculateProcessorTopology.
> 
> CalculateProcessorTopology tries to figure out system topology by parsing
> /proc/cpuinfo to determine the number of threads, cores, and NUMA
> nodes.  There are some architectures where the "physical id" begins with 1
> rather than 0, which was creating and empty "0" node and causing a crash in
> CreateThreadPool.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97102
> ---
>  src/gallium/drivers/swr/rasterizer/core/threads.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp
> b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
> index ee12612..f1c3030 100644
> --- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp
> +++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
> @@ -217,6 +217,15 @@ void CalculateProcessorTopology(CPUNumaNodes&
> out_nodes, uint32_t& out_numThread
>          out_numThreadsPerProcGroup++;
>      }
> 
> +    /* Prune empty numa nodes */
> +    for (auto it = out_nodes.begin(); it != out_nodes.end(); ) {
> +       if ((*it).cores.size() == 0)
> +          it = out_nodes.erase(it);
> +       else
> +          ++it;
> +    }
> +
> +    /* Prune empty core nodes */
>      for (uint32_t node = 0; node < out_nodes.size(); node++) {
>          auto& numaNode = out_nodes[node];
>          auto it = numaNode.cores.begin();
> --
> 2.7.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list