[Openmp-commits] [openmp] r320593 - [AArch64] fix an issue with older /proc/cpuinfo layout

Paul Osmialowski via Openmp-commits openmp-commits at lists.llvm.org
Wed Dec 13 08:12:24 PST 2017

Author: pawosm01
Date: Wed Dec 13 08:12:24 2017
New Revision: 320593

URL: http://llvm.org/viewvc/llvm-project?rev=320593&view=rev
[AArch64] fix an issue with older /proc/cpuinfo layout

There are two /proc/cpuinfo layots in use for AArch64: old and new.
The old one has all 'processor : n' lines in one section, hence
checking for duplications does not make sense.

Differential Revision: https://reviews.llvm.org/D41000


Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=320593&r1=320592&r2=320593&view=diff
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Wed Dec 13 08:12:24 2017
@@ -2028,7 +2028,15 @@ static int __kmp_affinity_create_cpuinfo
         if ((p == NULL) || (KMP_SSCANF(p + 1, "%u\n", &val) != 1))
           goto no_val;
         if (threadInfo[num_avail][osIdIndex] != UINT_MAX)
+          // Handle the old AArch64 /proc/cpuinfo layout differently,
+          // it contains all of the 'processor' entries listed in a
+          // single 'Processor' section, therefore the normal looking
+          // for duplicates in that section will always fail.
+          num_avail++;
           goto dup_field;
         threadInfo[num_avail][osIdIndex] = val;
 #if KMP_OS_LINUX && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)
         char path[256];

More information about the Openmp-commits mailing list