<div dir="ltr">This may not be the best thing to do for performance though; it may spawn few threads per pool and limit performance. Please don't push this in.<div><br><div>I think it may be better to spawn 64-threads in case the delta between # cores and 64 is < x% of 64 - basically if the second pool won't have "enough" threads to work on, don't spawn a second pool at all! I will send a patch for this assuming x to be 50%.</div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Pradeep Ramachandran, PhD<div>Solution Architect,</div><div>Multicoreware Inc.</div><div>Ph:   +91 99627 82018</div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Aug 24, 2015 at 6:55 PM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 08/24, <a href="mailto:pradeep@multicorewareinc.com">pradeep@multicorewareinc.com</a> wrote:<br>
> # HG changeset patch<br>
> # User pradeep<br>
> # Date 1440406873 -19800<br>
> #      Mon Aug 24 14:31:13 2015 +0530<br>
> # Node ID cf6210f6f5cbbeec441f7eee3d8abf82208942fd<br>
> # Parent  f63273fa3137fef2f6898c686b68ee12608acd31<br>
> Performance: Balance # threads per pool for non-NUMA machines with > 64 vCPUs<br>
><br>
> By default, each thread pool may have up to 64 threads. In the case of a CPU that<br>
> has > 64 threads without NUMA support, we end up creating the first pool with 64<br>
> threads and the other pool with a few stray threads significantly affecting performance.<br>
> This fix balances the threads out in that case.<br>
><br>
> diff -r f63273fa3137 -r cf6210f6f5cb source/common/threadpool.cpp<br>
> --- a/source/common/threadpool.cpp    Thu Aug 20 11:13:25 2015 +0530<br>
> +++ b/source/common/threadpool.cpp    Mon Aug 24 14:31:13 2015 +0530<br>
> @@ -307,6 +307,16 @@<br>
>          numPools = X265_MAX(p->frameNumThreads / 2, 1);<br>
>      }<br>
><br>
> +    // In the case that numa is disabled and we have more CPUs than 64,<br>
> +    // balance the # threads created across thread pools<br>
> +    if ((numNumaNodes==1) && (numPools > 1))<br>
> +    {<br>
> +        int threads = cpusPerNode[0];<br>
> +        for (int i = 0; i < numPools; i++)<br>
> +            cpusPerNode[i] = threads / numPools;<br>
> +        cpusPerNode[0] += (threads % numPools) ;<br>
> +    }<br>
<br>
</div></div>other than w/s nits this seems fine.<br>
<span class=""><br>
>      ThreadPool *pools = new ThreadPool[numPools];<br>
>      if (pools)<br>
>      {<br>
</span>> _______________________________________________<br>
> x265-devel mailing list<br>
> <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
> <a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Steve Borho<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</font></span></blockquote></div><br></div>