llvm-project/compiler-rt/lib/dfsan
Jianzhou Zhao 91dc545bf2 Set Huge Page mode on shadow regions based on no_huge_pages_for_shadow
It turned out that at dynamic shared library mode, the memory access
pattern can increase memory footprint significantly on OS when transparent
hugepages (THP) are enabled. This could cause >70x memory overhead than
running a static linked binary. For example, a static binary with RSS
overhead 300M can use > 23G RSS if it is built dynamically.
/proc/../smaps shows in 6204552 kB RSS 6141952 kB relates to
AnonHugePages.

Also such a high RSS happens in some rate: around 25% runs may use > 23G RSS, the
rest uses in between 6-23G. I guess this may relate to how user memory
is allocated and distributted across huge pages.

THP is a trade-off between time and space. We have a flag
no_huge_pages_for_shadow for sanitizer. It is true by default but DFSan
did not follow this. Depending on if a target is built statically or
dynamically, maybe Clang can set no_huge_pages_for_shadow accordingly
after this change. But it still seems fine to follow the default setting of
no_huge_pages_for_shadow. If time is an issue, and users are fine with
high RSS, this flag can be set to false selectively.
2020-10-20 16:50:59 +00:00
..
scripts compiler-rt: Rename .cc file in test/dfsan to cpp 2019-08-05 13:19:28 +00:00
.clang-format [sanitizer] Remove unneeded blank lines 2018-05-09 00:44:26 +00:00
CMakeLists.txt compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
dfsan.cpp Set Huge Page mode on shadow regions based on no_huge_pages_for_shadow 2020-10-20 16:50:59 +00:00
dfsan.h [compiler-rt] Remove some cpplint filters 2019-09-12 02:20:36 +00:00
dfsan.syms.extra
dfsan_custom.cpp [DFSan] Add strpbrk wrapper. 2020-09-18 08:54:14 -07:00
dfsan_flags.inc [DFSan] Add efficient fast16labels instrumentation mode. 2020-07-29 18:58:47 +00:00
dfsan_interceptors.cpp Release pages to OS when setting 0 label 2020-10-20 16:22:11 +00:00
dfsan_platform.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
done_abilist.txt [DFSan] Add strpbrk wrapper. 2020-09-18 08:54:14 -07:00
libc_ubuntu1404_abilist.txt