hanchenye-llvm-project/compiler-rt
Kostya Kortchinsky d276d72441 [sanitizer] Introduce a vDSO aware time function, and use it in the allocator [redo]
Summary:
Redo of D40657, which had the initial discussion. The initial code had to move
into a libcdep file, and things had to be shuffled accordingly.

`NanoTime` is a time sink when checking whether or not to release memory to
the OS. While reducing the amount of calls to said function is in the works,
another solution that was found to be beneficial was to use a timing function
that can leverage the vDSO.

We hit a couple of snags along the way, like the fact that the glibc crashes
when clock_gettime is called from a preinit_array, or the fact that
`__vdso_clock_gettime` is mangled (for security purposes) and can't be used
directly, and also that clock_gettime can be intercepted.

The proposed solution takes care of all this as far as I can tell, and
significantly improve performances and some Scudo load tests with memory
reclaiming enabled.

@mcgrathr: please feel free to follow up on
https://reviews.llvm.org/D40657#940857 here. I posted a reply at
https://reviews.llvm.org/D40657#940974.

Reviewers: alekseyshl, krytarowski, flowerhack, mcgrathr, kubamracek

Reviewed By: alekseyshl, krytarowski

Subscribers: #sanitizers, mcgrathr, srhines, llvm-commits, kubamracek

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

llvm-svn: 320409
2017-12-11 19:23:12 +00:00
..
cmake Hardware-assisted AddressSanitizer (compiler-rt) 2017-12-09 01:31:51 +00:00
docs
include Hardware-assisted AddressSanitizer (compiler-rt) 2017-12-09 01:31:51 +00:00
lib [sanitizer] Introduce a vDSO aware time function, and use it in the allocator [redo] 2017-12-11 19:23:12 +00:00
test Update another sanitizer test for C++14. 2017-12-10 05:50:23 +00:00
unittests Allow compiler-rt test targets to work with multi-config CMake generators 2017-11-13 12:57:54 +00:00
www
.arcconfig [compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository 2017-12-06 20:55:32 +00:00
.gitignore Add .pyc files to .gitignore to compiler-rt 2017-07-24 21:51:12 +00:00
CMakeLists.txt [compiler-rt] Remove out of date comment 2017-12-01 19:06:30 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================