Skip to content

Commit

Permalink
pa: enable tweaks that reduce calls to madvise/mprotect
Browse files Browse the repository at this point in the history
Data looks good, so enabling by default.

Only enabling on mac as mac benefits the most from this optimization
(madvise/mprotect seem more expensive on mac, and we have to make
double the number of them).

Bug: 329199197
Change-Id: If35cee249658082de3b182070f43dd3fc045f552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5598060
Reviewed-by: Benoit Lize <lizeb@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310654}
  • Loading branch information
Scott Violet authored and pull[bot] committed Jun 17, 2024
1 parent 50a5e05 commit 1355520
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
10 changes: 9 additions & 1 deletion base/allocator/partition_alloc_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ MIRACLE_PARAMETER_FOR_INT(

BASE_FEATURE(kPartitionAllocLargeEmptySlotSpanRing,
"PartitionAllocLargeEmptySlotSpanRing",
#if BUILDFLAG(IS_MAC)
FEATURE_ENABLED_BY_DEFAULT);
#else
FEATURE_DISABLED_BY_DEFAULT);
#endif

BASE_FEATURE(kPartitionAllocSchedulerLoopQuarantine,
"PartitionAllocSchedulerLoopQuarantine",
Expand Down Expand Up @@ -486,7 +490,11 @@ void MakeFreeNoOp(WhenFreeBecomesNoOp callsite) {

BASE_FEATURE(kPartitionAllocAdjustSizeWhenInForeground,
"PartitionAllocAdjustSizeWhenInForeground",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_MAC)
FEATURE_ENABLED_BY_DEFAULT);
#else
FEATURE_DISABLED_BY_DEFAULT);
#endif

BASE_FEATURE(kPartitionAllocUseSmallSingleSlotSpans,
"PartitionAllocUseSmallSingleSlotSpans",
Expand Down
17 changes: 0 additions & 17 deletions testing/variations/fieldtrial_testing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15032,23 +15032,6 @@
]
}
],
"PartitionAllocParameterTuning": [
{
"platforms": [
"mac"
],
"experiments": [
{
"name": "Enabled_20240318",
"enable_features": [
"BlinkUseLargeEmptySlotSpanRingForBufferRoot",
"PartitionAllocAdjustSizeWhenInForeground",
"PartitionAllocLargeEmptySlotSpanRing"
]
}
]
}
],
"PartitionAllocShortMemoryReclaim": [
{
"platforms": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ const char* const Partitions::kAllocatedObjectPoolName =

BASE_FEATURE(kBlinkUseLargeEmptySlotSpanRingForBufferRoot,
"BlinkUseLargeEmptySlotSpanRingForBufferRoot",
#if BUILDFLAG(IS_MAC)
base::FEATURE_ENABLED_BY_DEFAULT);
#else
base::FEATURE_DISABLED_BY_DEFAULT);
#endif

#if PA_BUILDFLAG(USE_STARSCAN)
// Runs PCScan on WTF partitions.
Expand Down

0 comments on commit 1355520

Please sign in to comment.