[compiler-rt] r214394 - tsan: use MADV_NOHUGEPAGE only if it is supported by platform

Dmitry Vyukov dvyukov at google.com
Thu Jul 31 01:24:59 PDT 2014


Author: dvyukov
Date: Thu Jul 31 03:24:59 2014
New Revision: 214394

URL: http://llvm.org/viewvc/llvm-project?rev=214394&view=rev
Log:
tsan: use MADV_NOHUGEPAGE only if it is supported by platform
Fixes build failure on an old system:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-centos-6.5/builds/7555/steps/build/logs/stdio


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=214394&r1=214393&r2=214394&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Thu Jul 31 03:24:59 2014
@@ -232,8 +232,10 @@ void InitializeShadowMemory() {
   // Frequently a thread uses only a small part of stack and similarly
   // a program uses a small part of large mmap. On some programs
   // we see 20% memory usage reduction without huge pages for this range.
+#ifdef MADV_NOHUGEPAGE
   madvise((void*)MemToShadow(0x7f0000000000ULL),
       0x10000000000ULL * kShadowMultiplier, MADV_NOHUGEPAGE);
+#endif
   DPrintf("memory shadow: %zx-%zx (%zuGB)\n",
       kLinuxShadowBeg, kLinuxShadowEnd,
       (kLinuxShadowEnd - kLinuxShadowBeg) >> 30);





More information about the llvm-commits mailing list