<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 12:49 PM, Mateusz <span dir="ltr"><<a href="mailto:mateuszb@poczta.onet.pl" target="_blank">mateuszb@poczta.onet.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Using numNumaNodes * MAX_POOL_THREADS as the upper-bound on the # threads per numa node isn't the cleanest.<br>
<br></span>
My intention was to use the upper-bound for whole threads number (on all NUMAs).<br>
<br>
This patch is only for case '--pools N' where N is a number, for example '--pools 55' create exactly 55 threads (with affinity for all logical CPUs on all NUMAs). Old logic for '--pools 55' was to create min(55, #CPU on NUMA 0) threads on NUMA 0 and 0 threads on all remaining NUMAs. To use old logic with this patch you can add comma: '--pools 55,'<br></blockquote><div><br></div><div>In a machine with N nodes, the logical thing to do is to specify N values to the --pools option. The effect above that you describe when only one value is specified is just coincidence and certainly not intentional. Enabling support with '--pools 55,' for example, isn't really essential.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If I use '--pools 6144 -F16' option with this patch on i5 CPU, I get<br>
x265 [info]: Thread pool created using 64 threads<br>
x265 [info]: frame threads / pool features : 16 / wpp(12 rows)<br>
<br>
Without this patch I get only 4 threads.</blockquote><div><br>This is the problem that I feared - since the HW has only 4 threads, even though you specified 6144 as the # SW threads you wanted to create, we should've spawned only 4 SW threads also. Using min CPUs across all NUMA nodes will ensure that you only spawn 4 SW threads. You are currently clipped at 64 threads because that is the max # threads in on pool (limited by the fact that we use a 64-bit bit vector for a mask and hence can only track 64 threads per pool).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Also, can you please include the patch as inline in future so that it becomes easier to review?<br>
<br></span>
I will do that, thanks for info. My first attempt to do this fail due to line breaking in my e-mail client.<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">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>
</div></div></blockquote></div><br></div></div>