diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-10-27 17:28:58 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-11-10 13:13:28 +0000 |
commit | 940e6c9d26246678b7fc6c79a8d957abb7d6dfa6 (patch) | |
tree | 00c3b75388f07196db9c3bccd79e7e9f00e6bacb /chromium/base | |
parent | 3dce9b5818576f04ce21cec4b3686eda012e5b65 (diff) |
BASELINE: Update Chromium to 118.0.5993.68
Change-Id: I6e6d99002554d348799de08959e84e67a07d0dc0
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/517433
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base')
-rw-r--r-- | chromium/base/task/task_features.cc | 6 | ||||
-rw-r--r-- | chromium/base/task/task_features.h | 5 | ||||
-rw-r--r-- | chromium/base/task/thread_pool/thread_pool_impl.cc | 18 |
3 files changed, 12 insertions, 17 deletions
diff --git a/chromium/base/task/task_features.cc b/chromium/base/task/task_features.cc index 3644fb419b0..24c774fd50f 100644 --- a/chromium/base/task/task_features.cc +++ b/chromium/base/task/task_features.cc @@ -59,12 +59,12 @@ BASE_FEATURE(kExplicitHighResolutionTimerWin, BASE_FEATURE(kRunTasksByBatches, "RunTasksByBatches", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kThreadPoolCap, - "ThreadPoolCap", +BASE_FEATURE(kThreadPoolCap2, + "ThreadPoolCap2", base::FEATURE_DISABLED_BY_DEFAULT); const base::FeatureParam<int> kThreadPoolCapRestrictedCount{ - &kThreadPoolCap, "restricted_count", 3}; + &kThreadPoolCap2, "restricted_count", 3}; // Leeway value applied to delayed tasks. An atomic is used here because the // value is queried from multiple threads. diff --git a/chromium/base/task/task_features.h b/chromium/base/task/task_features.h index 0eb8fb046f6..a86e0760d6d 100644 --- a/chromium/base/task/task_features.h +++ b/chromium/base/task/task_features.h @@ -12,9 +12,8 @@ namespace base { -// Amount of threads that will be system-wide restricted from being used -// by thread pools. -BASE_EXPORT BASE_DECLARE_FEATURE(kThreadPoolCap); +// Fixed amount of threads that will be used as a cap for thread pools. +BASE_EXPORT BASE_DECLARE_FEATURE(kThreadPoolCap2); extern const BASE_EXPORT base::FeatureParam<int> kThreadPoolCapRestrictedCount; diff --git a/chromium/base/task/thread_pool/thread_pool_impl.cc b/chromium/base/task/thread_pool/thread_pool_impl.cc index 7f15cb26efd..f7e359a79c2 100644 --- a/chromium/base/task/thread_pool/thread_pool_impl.cc +++ b/chromium/base/task/thread_pool/thread_pool_impl.cc @@ -181,17 +181,13 @@ void ThreadPoolImpl::Start(const ThreadPoolInstance::InitParams& init_params, size_t foreground_threads = init_params.max_num_foreground_threads; size_t utility_threads = init_params.max_num_utility_threads; - // Set the size of each ThreadGroup such that N cores are left available - // for other threads. N is the number of threads that the application is - // expected to need to be responsive (currently configurable via field trial). - // The size of each ThreadGroup can grow beyond the value set here when tasks - // enter ScopedBlockingCall. - if (base::FeatureList::IsEnabled(kThreadPoolCap)) { - int restricted_threads = kThreadPoolCapRestrictedCount.Get(); - int max_allowed_workers_per_pool = - (base::SysInfo::NumberOfProcessors() - restricted_threads); - // Set a positive minimum amount of workers per pool. - max_allowed_workers_per_pool = std::max(2, max_allowed_workers_per_pool); + + if (base::FeatureList::IsEnabled(kThreadPoolCap2)) { + // Set the size of each ThreadGroup to a initial fixed size which can grow + // beyond the value set here when tasks enter ScopedBlockingCall and + // set a minimum amount of workers per pool. + const int max_allowed_workers_per_pool = + std::max(2, kThreadPoolCapRestrictedCount.Get()); foreground_threads = std::min(init_params.max_num_foreground_threads, static_cast<size_t>(max_allowed_workers_per_pool)); |