summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
author Ruben Ayrapetyan <ruben.ayrapetyan@arm.com> 2023-12-22 13:04:00 +0000
committer Steven Moreland <smoreland@google.com> 2023-12-26 19:40:46 +0000
commitc411c29cbf80bb48d63cc5bd8fbb69ae97a95902 (patch)
tree2de967ad75544b3d2236d9e92b34690ba04ad872 /compiler/common_compiler_test.cc
parentc4c2517940348137a780ae924253589f1423c23c (diff)
Use runtime page size for large object alignment
In general, this removes `kLargeObjectAlignment` and replaces it with a dynamic `LargeObjectSpace::ObjectAlignment()` static method. It avoids consuming extra memory to align up large object to `kMaxPageSize` (16K), when the runtime page size is 4K. However, in order to keep `SpaceBitmap<kAlignment>` optimized, this keeps the internal bitmap alignment fixed to the minimal page size (4K), We then accept that if the page size is 16K at runtime, then only 1 bit out of every 4 bits will actually be in-use. Assuming a heap capacity of 256M, the size of the bitmap is as follows: - 4K: (256M / 4K) -> 64K pages -> 8K needed to store one bit per page. - 16K: (256M / 16K) -> 16K pages -> 2K needed to store one bit per page. As a temporary solution, it's acceptable to consume 8K regardless of the runtime page size. In the future, as 16K page sizes becomes more common, we may need to re-think how large object spaces work, and if it still makes sense to have the large object alignment tied to the OS page size. To cover testing, this CL turns the existing space bitmap unit tests into type-paramaterized tests, based on the SpaceBitmap implementation and the object alignment they can support: | SpaceBitmapType | SpaceBitmap alignment | Object alignment | |-----------------------+-----------------------+--------------------| | ContinuousSpaceBitmap | kObjectAlignment | kObjectAlignment | | LargeObjectBimap | kMinPageSize (4K) | kMinPageSize (4K) | | LargeObjectBimap | kMinPageSize (4K) | kMaxPageSize (16K) | In passing, this also removes the templated version of MapAnonymousAligned(), as it was only used to allocate large objects, outside of tests. And highlights that its alignment must be higher than gPageSize. The image tests are also adapted accordingly. Test: art/test/testrunner/testrunner.py -b --host on host Test: art/test/testrunner/testrunner.py --target --64 \ --optimizing --gcverify --gcstress Test: art/tools/run-gtests.sh -- -j6 Test: art/tools/run-gtests.sh \ /apex/com.android.art/bin/art/arm64/art_runtime_tests \ -- --gtest_filter="*SpaceBitmap*" on target Pixel6 Author: Pierre Langlois <pierre.langlois@arm.com> Change-Id: Ib1251c88be1380168e3b5cf9126611e5daef5db1
Diffstat (limited to 'compiler/common_compiler_test.cc')
0 files changed, 0 insertions, 0 deletions