[compiler-rt] r240028 - tsan: mark meta shadow as NOHUGEPAGE

Dmitry Vyukov dvyukov at google.com
Thu Jun 18 09:57:38 PDT 2015


Author: dvyukov
Date: Thu Jun 18 11:57:37 2015
New Revision: 240028

URL: http://llvm.org/viewvc/llvm-project?rev=240028&view=rev
Log:
tsan: mark meta shadow as NOHUGEPAGE

Meta shadow is compressing and we don't flush it,
so it makes sense to mark it as NOHUGEPAGE to not over-allocate memory.
On one program it reduces memory consumption from 5GB to 2.5GB.



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=240028&r1=240027&r2=240028&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Thu Jun 18 11:57:37 2015
@@ -224,6 +224,10 @@ void InitializeShadowMemory() {
 #endif
   NoHugePagesInRegion(MemToShadow(kMadviseRangeBeg),
                       kMadviseRangeSize * kShadowMultiplier);
+  // Meta shadow is compressing and we don't flush it,
+  // so it makes sense to mark it as NOHUGEPAGE to not over-allocate memory.
+  // On one program it reduces memory consumption from 5GB to 2.5GB.
+  NoHugePagesInRegion(kMetaShadowBeg, kMetaShadowEnd - kMetaShadowBeg);
   if (common_flags()->use_madv_dontdump)
     DontDumpShadowMemory(kShadowBeg, kShadowEnd - kShadowBeg);
   DPrintf("memory shadow: %zx-%zx (%zuGB)\n",





More information about the llvm-commits mailing list