aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-01-04 22:55:04 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-01-04 22:55:04 +0000
commit9fbc364e1636a99dc2ee55e31338ad3415716359 (patch)
tree9584c0a81b551921f58d627b3fcede914fa885a2 /compiler-rt/lib/sanitizer_common
parent[PGO] Use SourceFileName rather module name in PGOFuncName (diff)
downloadllvm-project-9fbc364e1636a99dc2ee55e31338ad3415716359.tar.gz
llvm-project-9fbc364e1636a99dc2ee55e31338ad3415716359.tar.bz2
llvm-project-9fbc364e1636a99dc2ee55e31338ad3415716359.zip
[sanitizer] Reduce stack depot size on Android.
Summary: The default setting kTabSizeLog=20 results in an 8Mb global hash table, almost all of it in private pages. That is not a sane setting in a mobile, system-wide use case: with ~150 concurrent processes stack depot will account for more than 1Gb of RAM. Reviewers: kcc, pcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56333 llvm-svn: 350443
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc2
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc
index 3bd5b677a1f8..6aab98485226 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cc
@@ -26,7 +26,7 @@ struct StackDepotNode {
u32 tag;
uptr stack[1]; // [size]
- static const u32 kTabSizeLog = 20;
+ static const u32 kTabSizeLog = SANITIZER_ANDROID ? 16 : 20;
// Lower kTabSizeLog bits are equal for all items in one bucket.
// We use these bits to store the per-stack use counter.
static const u32 kUseCountBits = kTabSizeLog;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h
index cb7345002a40..e22ed2e38e57 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h
@@ -32,7 +32,7 @@ struct StackDepotHandle {
void inc_use_count_unsafe();
};
-const int kStackDepotMaxUseCount = 1U << 20;
+const int kStackDepotMaxUseCount = 1U << (SANITIZER_ANDROID ? 16 : 20);
StackDepotStats *StackDepotGetStats();
u32 StackDepotPut(StackTrace stack);