diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2018-03-09 16:18:38 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2018-03-09 16:18:38 +0000 |
commit | 0d7956335942ee1e32255e12d3b302c80ae5d021 (patch) | |
tree | 4774ebe0ba41042297ec785c4e826cd5c3803fd5 /test/cfi/simple-pass.cpp | |
parent | 1f433c4909dd21b31269d42ca116187d1bdc55fc (diff) |
[sanitizer] Align & pad the allocator structures to the cacheline size
Summary:
Both `SizeClassInfo` structures for the 32-bit primary & `RegionInfo`
structures for the 64-bit primary can be used by different threads, and as such
they should be aligned & padded to the cacheline size to avoid false sharing.
The former was padded but the array was not aligned, the latter was not padded
but we lucked up as the size of the structure was 192 bytes, and aligned by
the properties of `mmap`.
I plan on adding a couple of fields to the `RegionInfo`, and some highly
threaded tests pointed out that without proper padding & alignment, performance
was getting a hit - and it is going away with proper padding.
This patch makes sure that we are properly padded & aligned for both. I used
a template to avoid padding if the size is already a multiple of the cacheline
size. There might be a better way to do this, I am open to suggestions.
Reviewers: alekseyshl, dvyukov
Reviewed By: alekseyshl
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D44261
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/cfi/simple-pass.cpp')
0 files changed, 0 insertions, 0 deletions