[PATCH] D65775: [Sanitizer] Linux explicitally migrate shadow mapping to Transparent Huge Page
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 14:29:27 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL368090: [Sanitizer] Linux explicitally migrate shadow mapping to Transparent Huge Page (authored by devnexen, committed by ).
Herald added a subscriber: delcypher.
Changed prior to commit:
https://reviews.llvm.org/D65775?vs=213702&id=213723#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65775/new/
https://reviews.llvm.org/D65775
Files:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cpp
compiler-rt/trunk/lib/tsan/rtl/tsan_platform_posix.cpp
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
@@ -131,7 +131,7 @@
void IncreaseTotalMmap(uptr size);
void DecreaseTotalMmap(uptr size);
uptr GetRSS();
-bool SetShadowRegionHugePageMode(uptr addr, uptr length);
+void SetShadowRegionHugePageMode(uptr addr, uptr length);
bool DontDumpShadowMemory(uptr addr, uptr length);
// Check if the built VMA size matches the runtime one.
void CheckVMASize();
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cpp
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cpp
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cpp
@@ -329,9 +329,8 @@
// FIXME: add madvise-analog when we move to 64-bits.
}
-bool SetShadowRegionHugePageMode(uptr addr, uptr size) {
+void SetShadowRegionHugePageMode(uptr addr, uptr size) {
// FIXME: probably similar to ReleaseMemoryToOS.
- return true;
}
bool DontDumpShadowMemory(uptr addr, uptr length) {
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -68,13 +68,12 @@
SANITIZER_MADVISE_DONTNEED);
}
-bool SetShadowRegionHugePageMode(uptr addr, uptr size) {
+void SetShadowRegionHugePageMode(uptr addr, uptr size) {
#ifdef MADV_NOHUGEPAGE // May not be defined on old systems.
if (common_flags()->no_huge_pages_for_shadow)
- return madvise((char *)addr, size, MADV_NOHUGEPAGE) == 0;
- return true;
-#else
- return true;
+ madvise((char *)addr, size, MADV_NOHUGEPAGE);
+ else
+ madvise((char *)addr, size, MADV_HUGEPAGE) == 0;
#endif // MADV_NOHUGEPAGE
}
Index: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_posix.cpp
===================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_posix.cpp
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_posix.cpp
@@ -30,13 +30,7 @@
"TSAN_OPTIONS=%s=0\n";
static void NoHugePagesInShadow(uptr addr, uptr size) {
- if (!SetShadowRegionHugePageMode(addr, size)) {
- Printf(kShadowMemoryMappingWarning, SanitizerToolName, addr, addr + size,
- "MADV_NOHUGEPAGE", errno);
- Printf(kShadowMemoryMappingHint, "MADV_NOHUGEPAGE",
- "no_huge_pages_for_shadow");
- Die();
- }
+ SetShadowRegionHugePageMode(addr, size);
}
static void DontDumpShadow(uptr addr, uptr size) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65775.213723.patch
Type: text/x-patch
Size: 2752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190806/34ac3186/attachment-0001.bin>
More information about the llvm-commits
mailing list