-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[scudo] Remove AndroidSvelteConfig. #66444
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This config is not actually used anywhere and it is not used on Android. Since it does not test anything not tested elsewhere, remove it. Remove the size class data associated with this config too.
@llvm/pr-subscribers-compiler-rt-sanitizer ChangesThis config is not actually used anywhere and it is not used on Android. Since it does not test anything not tested elsewhere, remove it.Remove the size class data associated with this config too.Full diff: https://github.com/llvm/llvm-project/pull/66444.diff 7 Files Affected:
diff --git a/compiler-rt/lib/scudo/standalone/allocator_config.h b/compiler-rt/lib/scudo/standalone/allocator_config.h index 315a04f7635dad9..44c1ac5f74a2f2f 100644 --- a/compiler-rt/lib/scudo/standalone/allocator_config.h +++ b/compiler-rt/lib/scudo/standalone/allocator_config.h @@ -195,50 +195,6 @@ struct AndroidConfig { template <typename Config> using SecondaryT = MapAllocator<Config>; }; -struct AndroidSvelteConfig { - static const bool MaySupportMemoryTagging = false; - template <class A> - using TSDRegistryT = TSDRegistrySharedT<A, 2U, 1U>; // Shared, max 2 TSDs. - - struct Primary { - using SizeClassMap = SvelteSizeClassMap; -#if SCUDO_CAN_USE_PRIMARY64 - static const uptr RegionSizeLog = 27U; - typedef u32 CompactPtrT; - static const uptr CompactPtrScale = SCUDO_MIN_ALIGNMENT_LOG; - static const uptr GroupSizeLog = 18U; - static const bool EnableRandomOffset = true; - static const uptr MapSizeIncrement = 1UL << 18; -#else - static const uptr RegionSizeLog = 16U; - static const uptr GroupSizeLog = 16U; - typedef uptr CompactPtrT; -#endif - static const s32 MinReleaseToOsIntervalMs = 1000; - static const s32 MaxReleaseToOsIntervalMs = 1000; - }; - -#if SCUDO_CAN_USE_PRIMARY64 - template <typename Config> using PrimaryT = SizeClassAllocator64<Config>; -#else - template <typename Config> using PrimaryT = SizeClassAllocator32<Config>; -#endif - - struct Secondary { - struct Cache { - static const u32 EntriesArraySize = 16U; - static const u32 QuarantineSize = 32U; - static const u32 DefaultMaxEntriesCount = 4U; - static const uptr DefaultMaxEntrySize = 1UL << 18; - static const s32 MinReleaseToOsIntervalMs = 0; - static const s32 MaxReleaseToOsIntervalMs = 0; - }; - template <typename Config> using CacheT = MapAllocatorCache<Config>; - }; - - template <typename Config> using SecondaryT = MapAllocator<Config>; -}; - #if SCUDO_CAN_USE_PRIMARY64 struct FuchsiaConfig { static const bool MaySupportMemoryTagging = false; diff --git a/compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp b/compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp index 2adec88da3e4064..4fb05b7614c422b 100644 --- a/compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp +++ b/compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp @@ -52,8 +52,6 @@ static const size_t MaxSize = 128 * 1024; // cleanly. BENCHMARK_TEMPLATE(BM_malloc_free, scudo::AndroidConfig) ->Range(MinSize, MaxSize); -BENCHMARK_TEMPLATE(BM_malloc_free, scudo::AndroidSvelteConfig) - ->Range(MinSize, MaxSize); #if SCUDO_CAN_USE_PRIMARY64 BENCHMARK_TEMPLATE(BM_malloc_free, scudo::FuchsiaConfig) ->Range(MinSize, MaxSize); @@ -99,8 +97,6 @@ static const size_t MaxIters = 32 * 1024; // cleanly. BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::AndroidConfig) ->Range(MinIters, MaxIters); -BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::AndroidSvelteConfig) - ->Range(MinIters, MaxIters); #if SCUDO_CAN_USE_PRIMARY64 BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::FuchsiaConfig) ->Range(MinIters, MaxIters); diff --git a/compiler-rt/lib/scudo/standalone/size_class_map.h b/compiler-rt/lib/scudo/standalone/size_class_map.h index ebce720fe9f52c2..4138885de338e2f 100644 --- a/compiler-rt/lib/scudo/standalone/size_class_map.h +++ b/compiler-rt/lib/scudo/standalone/size_class_map.h @@ -289,28 +289,6 @@ typedef TableSizeClassMap<AndroidSizeClassConfig> AndroidSizeClassMap; static_assert(AndroidSizeClassMap::usesCompressedLSBFormat(), ""); #endif -struct SvelteSizeClassConfig { -#if SCUDO_WORDSIZE == 64U - static const uptr NumBits = 4; - static const uptr MinSizeLog = 4; - static const uptr MidSizeLog = 8; - static const uptr MaxSizeLog = 14; - static const u16 MaxNumCachedHint = 13; - static const uptr MaxBytesCachedLog = 10; - static const uptr SizeDelta = Chunk::getHeaderSize(); -#else - static const uptr NumBits = 4; - static const uptr MinSizeLog = 3; - static const uptr MidSizeLog = 7; - static const uptr MaxSizeLog = 14; - static const u16 MaxNumCachedHint = 14; - static const uptr MaxBytesCachedLog = 10; - static const uptr SizeDelta = Chunk::getHeaderSize(); -#endif -}; - -typedef FixedSizeClassMap<SvelteSizeClassConfig> SvelteSizeClassMap; - struct TrustySizeClassConfig { static const uptr NumBits = 1; static const uptr MinSizeLog = 5; diff --git a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp index 6ca9a7c7002ce3c..04176b9a4511ece 100644 --- a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp @@ -87,7 +87,6 @@ constexpr size_t kMaxAlign = std::max({ #if SCUDO_CAN_USE_PRIMARY64 alignof(scudo::Allocator<scudo::FuchsiaConfig>), #endif - alignof(scudo::Allocator<scudo::AndroidSvelteConfig>), alignof(scudo::Allocator<scudo::AndroidConfig>) }); @@ -101,7 +100,6 @@ struct TestAllocatorStorage { #if SCUDO_CAN_USE_PRIMARY64 sizeof(scudo::Allocator<scudo::FuchsiaConfig>), #endif - sizeof(scudo::Allocator<scudo::AndroidSvelteConfig>), sizeof(scudo::Allocator<scudo::AndroidConfig>) }); @@ -167,11 +165,9 @@ template <typename T> using ScudoCombinedDeathTest = ScudoCombinedTest<T>; #if SCUDO_FUCHSIA #define SCUDO_TYPED_TEST_ALL_TYPES(FIXTURE, NAME) \ - SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidSvelteConfig) \ SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, FuchsiaConfig) #else #define SCUDO_TYPED_TEST_ALL_TYPES(FIXTURE, NAME) \ - SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidSvelteConfig) \ SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, DefaultConfig) \ SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidConfig) #endif diff --git a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp index aebd4a998a6e67b..074977ff27e65f6 100644 --- a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp @@ -8,6 +8,7 @@ #include "tests/scudo_unit_test.h" +#include "allocator_config.h" #include "primary32.h" #include "primary64.h" #include "size_class_map.h" @@ -283,7 +284,7 @@ SCUDO_TYPED_TEST(ScudoPrimaryTest, PrimaryIterate) { } SCUDO_TYPED_TEST(ScudoPrimaryTest, PrimaryThreaded) { - using Primary = TestAllocator<TypeParam, scudo::SvelteSizeClassMap>; + using Primary = TestAllocator<TypeParam, scudo::Config::Primary::SizeClassMap>; std::unique_ptr<Primary> Allocator(new Primary); Allocator->init(/*ReleaseToOsInterval=*/-1); std::mutex Mutex; diff --git a/compiler-rt/lib/scudo/standalone/tests/release_test.cpp b/compiler-rt/lib/scudo/standalone/tests/release_test.cpp index 6b54c156aa6e58d..0ab49460807f297 100644 --- a/compiler-rt/lib/scudo/standalone/tests/release_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/release_test.cpp @@ -552,22 +552,16 @@ TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSAndroid) { testReleaseFreeMemoryToOS<scudo::AndroidSizeClassMap>(); } -TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSSvelte) { - testReleaseFreeMemoryToOS<scudo::SvelteSizeClassMap>(); -} - TEST(ScudoReleaseTest, PageMapMarkRange) { testPageMapMarkRange<scudo::DefaultSizeClassMap>(); testPageMapMarkRange<scudo::AndroidSizeClassMap>(); testPageMapMarkRange<scudo::FuchsiaSizeClassMap>(); - testPageMapMarkRange<scudo::SvelteSizeClassMap>(); } TEST(ScudoReleaseTest, ReleasePartialRegion) { testReleasePartialRegion<scudo::DefaultSizeClassMap>(); testReleasePartialRegion<scudo::AndroidSizeClassMap>(); testReleasePartialRegion<scudo::FuchsiaSizeClassMap>(); - testReleasePartialRegion<scudo::SvelteSizeClassMap>(); } template <class SizeClassMap> void testReleaseRangeWithSingleBlock() { @@ -630,7 +624,6 @@ TEST(ScudoReleaseTest, RangeReleaseRegionWithSingleBlock) { testReleaseRangeWithSingleBlock<scudo::DefaultSizeClassMap>(); testReleaseRangeWithSingleBlock<scudo::AndroidSizeClassMap>(); testReleaseRangeWithSingleBlock<scudo::FuchsiaSizeClassMap>(); - testReleaseRangeWithSingleBlock<scudo::SvelteSizeClassMap>(); } TEST(ScudoReleaseTest, BufferPool) { diff --git a/compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp b/compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp index b11db1e9f645efd..05b5835ff0bb684 100644 --- a/compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp @@ -20,10 +20,6 @@ TEST(ScudoSizeClassMapTest, DefaultSizeClassMap) { testSizeClassMap<scudo::DefaultSizeClassMap>(); } -TEST(ScudoSizeClassMapTest, SvelteSizeClassMap) { - testSizeClassMap<scudo::SvelteSizeClassMap>(); -} - TEST(ScudoSizeClassMapTest, AndroidSizeClassMap) { testSizeClassMap<scudo::AndroidSizeClassMap>(); } |
hctim
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay for cleanup
ChiaHungDuan
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
ZijunZhaoCCK
pushed a commit
to ZijunZhaoCCK/llvm-project
that referenced
this pull request
Sep 19, 2023
This config is not actually used anywhere and it is not used on Android. Since it does not test anything not tested elsewhere, remove it. Remove the size class data associated with this config too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This config is not actually used anywhere and it is not used on Android. Since it does not test anything not tested elsewhere, remove it.
Remove the size class data associated with this config too.