This is msan/dfsan data which does not need waste cache
of other sanitizers.
Depends on D111614.
Differential D111615
[sanitizer] Remove use_count from StackDepotNode vitalybuka on Oct 12 2021, 12:07 AM. Authored by
Details This is msan/dfsan data which does not need waste cache Depends on D111614.
Diff Detail
Event TimelineThis comment was removed by vitalybuka. Comment Actions 3-5 of https://reviews.llvm.org/D111614#3058999
Comment Actions Actually even as-is this patch is beneficial. So as I said this patch is NOOP for anything but msan-origins/dfsan. After the patch: autoninja -C ../out/z/ SanitizerUnitTests && ../out/z/projects/compiler-rt/lib/sanitizer_common/tests/./Sanitizer-x86_64-Test --gtest_also_run_disabled_tests --gtest_filter=*Benchmark* --gtest_repeat=1 [ OK ] SanitizerCommonBenchmarkSuite/SanitizerCommonBenchmark.DISABLED_BenchmarkInsertUniqueThreaded/3000000_10_16_UseCount (13520 ms) Before patch: autoninja -C ../out/z/ SanitizerUnitTests && ../out/z/projects/compiler-rt/lib/sanitizer_common/tests/./Sanitizer-x86_64-Test --gtest_also_run_disabled_tests --gtest_filter=*Benchmark* --gtest_repeat=1 [ OK ] SanitizerCommonBenchmarkSuite/SanitizerCommonBenchmark.DISABLED_BenchmarkInsertUniqueThreaded/3000000_10_16_UseCount (17402 ms) I assume this is because nodes are now in cache lines which are not modified by other threads. Comment Actions
fair |
These 2 changes combined (this and D111616) increase memory usage. Previously we had 16 byte node, after these changes we still 16 byte node, but also u32 in useCounts.
If node size is not shrinking, we can as well leave tag/size there.
It may also simplify things if we move useCounts into the trace (where we currently store size). Then we don't need a separate TwoLevelMap for useCounts.
Potentially we could get rid of tracePtrs as well, if the idx will point directly into traceAllocator (the current PersistentAllocator does not support it, but it could, or we could use something else, something like TwoLevelMap but with batch allocation where we can ask for N consecutive uptr's).