# HG changeset patch
# User Pradeep Ramachandran <[email protected]>
# Date 1464771107 -19800
# Wed Jun 01 14:21:47 2016 +0530
# Node ID c0f5b6fa11549aadf507b1bb7d7493c32773c187
# Parent 6d3849d648f0be5a8e334f1d75a2f7cf93c86cb3
threadpool: Fix counting of cpusPerNode for linux
diff -r 6d3849d648f0 -r c0f5b6fa1154 source/common/threadpool.cpp
--- a/source/common/threadpool.cpp Sun May 29 21:50:25 2016 +0800
+++ b/source/common/threadpool.cpp Wed Jun 01 14:21:47 2016 +0530
@@ -277,16 +277,16 @@
#elif HAVE_LIBNUMA
if (bNumaSupport)
{
+ struct bitmask* bitMask = numa_allocate_cpumask();
for (int i = 0; i < numNumaNodes; i++)
{
- struct bitmask* bitMask = numa_allocate_cpumask();
int ret = numa_node_to_cpus(i, bitMask);
if (!ret)
- cpusPerNode[i] = numa_num_possible_cpus();
+ cpusPerNode[i] = numa_bitmask_weight(bitMask);
else
x265_log(p, X265_LOG_ERROR, "Failed to genrate CPU mask\n");
- numa_free_cpumask(bitMask);
}
+ numa_free_cpumask(bitMask);
}
#else // NUMA not supported
cpusPerNode[0] = getCpuCount();
_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel