Commit 92eee5ef authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Chromium LUCI CQ

BackupRefPtrAndPCScan & PartitionAllocEverywhere experiments

Bring back synthetic PartitionAllocEverywhere experiment, scheduled for
1/8.

Also add synthetic BackupRefPtrAndPCScan experiment, scheduled for 1/12.
This requires disabling PCScan when BackupRefPtr is in use.

Bug: 1073933, 11297512
Change-Id: I5a575c4d60ff6d6eb196e0508851f279ce1fb7c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612307Reviewed-by: default avatarSébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAnton Bikineev <bikineev@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840943}
parent 9c8a98b3
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_FEATURES_H_
#include "base/allocator/buildflags.h" #include "base/allocator/buildflags.h"
#include "base/allocator/partition_allocator/checked_ptr_support.h"
#include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
#include "base/base_export.h" #include "base/base_export.h"
#include "base/feature_list.h" #include "base/feature_list.h"
...@@ -64,7 +65,7 @@ ALWAYS_INLINE bool IsPartitionAllocGigaCageEnabled() { ...@@ -64,7 +65,7 @@ ALWAYS_INLINE bool IsPartitionAllocGigaCageEnabled() {
} }
ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() { ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() {
#if defined(PA_HAS_64_BITS_POINTERS) #if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
return FeatureList::IsEnabled(kPartitionAllocPCScan); return FeatureList::IsEnabled(kPartitionAllocPCScan);
#else // PA_HAS_64_BITS_POINTERS #else // PA_HAS_64_BITS_POINTERS
return false; return false;
...@@ -73,7 +74,7 @@ ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() { ...@@ -73,7 +74,7 @@ ALWAYS_INLINE bool IsPartitionAllocPCScanEnabled() {
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
ALWAYS_INLINE bool IsPartitionAllocPCScanBrowserOnlyEnabled() { ALWAYS_INLINE bool IsPartitionAllocPCScanBrowserOnlyEnabled() {
#if defined(PA_HAS_64_BITS_POINTERS) #if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
return FeatureList::IsEnabled(kPartitionAllocPCScanBrowserOnly); return FeatureList::IsEnabled(kPartitionAllocPCScanBrowserOnly);
#else // PA_HAS_64_BITS_POINTERS #else // PA_HAS_64_BITS_POINTERS
return false; return false;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "base/allocator/partition_allocator/partition_root.h" #include "base/allocator/partition_allocator/partition_root.h"
#include "base/allocator/partition_allocator/checked_ptr_support.h"
#include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/oom.h"
#include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator.h"
#include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_check.h"
...@@ -27,7 +28,7 @@ typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode( ...@@ -27,7 +28,7 @@ typename PartitionRoot<thread_safe>::PCScanMode PartitionOptionsToPCScanMode(
// PCScan is currently only supported on 64-bit systems. // PCScan is currently only supported on 64-bit systems.
// Mark partitions non-scannable on 32-bit systems unconditionally, so that // Mark partitions non-scannable on 32-bit systems unconditionally, so that
// address space for quarantine bitmaps doesn't get reserved. // address space for quarantine bitmaps doesn't get reserved.
#if defined(PA_HAS_64_BITS_POINTERS) #if defined(PA_HAS_64_BITS_POINTERS) && !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
switch (opt) { switch (opt) {
case PartitionOptions::PCScan::kAlwaysDisabled: case PartitionOptions::PCScan::kAlwaysDisabled:
return Root::PCScanMode::kNonScannable; return Root::PCScanMode::kNonScannable;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <cmath> #include <cmath>
#include <string> #include <string>
#include "base/allocator/partition_allocator/checked_ptr_support.h"
#include "base/allocator/partition_allocator/partition_alloc_features.h" #include "base/allocator/partition_allocator/partition_alloc_features.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
...@@ -547,18 +548,29 @@ void ChromeBrowserMainExtraPartsMetrics::PreBrowserStart() { ...@@ -547,18 +548,29 @@ void ChromeBrowserMainExtraPartsMetrics::PreBrowserStart() {
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
// Records whether or not PartitionAlloc is used as the default allocator, // Records whether or not PartitionAlloc is used as the default allocator.
// plus whether or not PCScan is enabled.
ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
"PartitionAllocEverywhereAndPCScan", "PartitionAllocEverywhere",
#if BUILDFLAG(USE_PARTITION_ALLOC_EVERYWHERE) #if BUILDFLAG(USE_PARTITION_ALLOC_EVERYWHERE)
base::features::IsPartitionAllocPCScanBrowserOnlyEnabled() "Enabled"
? "EnabledWithPCScan"
: "EnabledWithoutPCScan"
#else #else
"Disabled" "Disabled"
#endif #endif
); );
#if defined(OS_WIN) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
// Records whether or not BackupRefPtr and/or PCScan is enabled.
ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
"BackupRefPtrAndPCScan",
#if ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
"BackupRefPtrEnabled"
#else
base::features::IsPartitionAllocPCScanBrowserOnlyEnabled()
? "PCScanEnabled"
: "Disabled"
#endif
);
#endif // defined(OS_WIN) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
} }
void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() { void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/platform/wtf/allocator/partitions.h" #include "third_party/blink/renderer/platform/wtf/allocator/partitions.h"
#include "base/allocator/partition_allocator/checked_ptr_support.h"
#include "base/allocator/partition_allocator/memory_reclaimer.h" #include "base/allocator/partition_allocator/memory_reclaimer.h"
#include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/oom.h"
#include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator.h"
...@@ -102,6 +103,7 @@ bool Partitions::InitializeOnce() { ...@@ -102,6 +103,7 @@ bool Partitions::InitializeOnce() {
buffer_root_ = buffer_allocator->root(); buffer_root_ = buffer_allocator->root();
layout_root_ = layout_allocator->root(); layout_root_ = layout_allocator->root();
#if !ENABLE_REF_COUNT_FOR_BACKUP_REF_PTR
if (base::features::IsPartitionAllocPCScanEnabled() || if (base::features::IsPartitionAllocPCScanEnabled() ||
base::FeatureList::IsEnabled(kPCScanBlinkPartitions)) { base::FeatureList::IsEnabled(kPCScanBlinkPartitions)) {
#if !BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) #if !BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
...@@ -109,6 +111,7 @@ bool Partitions::InitializeOnce() { ...@@ -109,6 +111,7 @@ bool Partitions::InitializeOnce() {
#endif #endif
buffer_root_->EnablePCScan(); buffer_root_->EnablePCScan();
} }
#endif
initialized_ = true; initialized_ = true;
return initialized_; return initialized_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment