Commit 0597fd97 authored by Eric Seckler's avatar Eric Seckler Committed by Commit Bot

webview: Use EnforceProcessCpuAffinity for little-only experiment

Switches the implementation of the --webview-force-little-cores switch
from base::SetProcessCpuAffinityMode to
content::EnforceProcessCpuAffinity. The latter periodically verifies
that the affinity setting remains active, to detect when the system
resets the affinity setting, and reapplies it if necessary.

Test: Run system WV shell with the flag & check chrome://histograms
Bug: 1111789
Change-Id: Icf4c360a36b8588086a0beb1caedd0e5869e3b59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2502430Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarLaís Minchillo <laisminchillo@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Laís Minchillo <laisminchillo@chromium.org>
Auto-Submit: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821681}
parent 1a26edba
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "content/public/common/content_descriptor_keys.h" #include "content/public/common/content_descriptor_keys.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/cpu_affinity.h"
#include "gin/public/isolate_holder.h" #include "gin/public/isolate_holder.h"
#include "gin/v8_initializer.h" #include "gin/v8_initializer.h"
#include "gpu/command_buffer/service/gpu_switches.h" #include "gpu/command_buffer/service/gpu_switches.h"
...@@ -299,8 +300,8 @@ void AwMainDelegate::PreSandboxStartup() { ...@@ -299,8 +300,8 @@ void AwMainDelegate::PreSandboxStartup() {
if (process_type == switches::kRendererProcess) { if (process_type == switches::kRendererProcess) {
InitResourceBundleRendererSide(); InitResourceBundleRendererSide();
if (command_line.HasSwitch(switches::kWebViewForceLittleCores)) { if (command_line.HasSwitch(switches::kWebViewForceLittleCores)) {
base::SetProcessCpuAffinityMode(base::GetCurrentProcessHandle(), content::EnforceProcessCpuAffinity(
base::CpuAffinityMode::kLittleCoresOnly); base::CpuAffinityMode::kLittleCoresOnly);
} }
} }
......
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