From 4e7f5070fcf22d9b8878f9a5d98a31f94f5ff6c2 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 11:05:21 -0700 Subject: [PATCH 1/6] [Impeller] Affinity adjustments for Vulkan backend. --- fml/cpu_affinity.cc | 1 - impeller/renderer/backend/vulkan/context_vk.cc | 4 ++++ impeller/renderer/backend/vulkan/fence_waiter_vk.cc | 10 +++++++++- .../renderer/backend/vulkan/resource_manager_vk.cc | 10 ++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/fml/cpu_affinity.cc b/fml/cpu_affinity.cc index c4e89613b252a..258a9ee0c68ba 100644 --- a/fml/cpu_affinity.cc +++ b/fml/cpu_affinity.cc @@ -61,7 +61,6 @@ const std::vector& CPUSpeedTracker::GetIndices( // required because files under /proc do not always return a valid size // when using fseek(0, SEEK_END) + ftell(). Nor can they be mmap()-ed. std::optional ReadIntFromFile(const std::string& path) { - // size_t data_length = 0u; std::ifstream file; file.open(path.c_str()); diff --git a/impeller/renderer/backend/vulkan/context_vk.cc b/impeller/renderer/backend/vulkan/context_vk.cc index 5453f060f7a44..4e5f885f909d5 100644 --- a/impeller/renderer/backend/vulkan/context_vk.cc +++ b/impeller/renderer/backend/vulkan/context_vk.cc @@ -8,6 +8,7 @@ #include #include #include +#include "flutter/fml/platform/android/cpu_affinity.h" #endif // FML_OS_ANDROID #include @@ -132,6 +133,9 @@ void ContextVK::Setup(Settings settings) { std::min(4u, std::thread::hardware_concurrency())); #ifdef FML_OS_ANDROID raster_message_loop_->PostTaskToAllWorkers([]() { + // Currently we only use the worker task pool for small parts of a frame + // workload, if this changes this setting may need to be adjusted. + fml::RequestAffinity(fml::CpuAffinity::kNotPerformance); if (::setpriority(PRIO_PROCESS, gettid(), -5) != 0) { FML_LOG(ERROR) << "Failed to set Workers task runner priority"; } diff --git a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc index 4a16c7a79a716..f1a4a097c2dff 100644 --- a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc +++ b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc @@ -8,6 +8,11 @@ #include #include +#ifdef FML_OS_ANDROID +#include "fml/cpu_affinity.h" +#include "flutter/fml/platform/android/cpu_affinity.h" +#endif // FML_OS_ANDROID + #include "flutter/fml/thread.h" #include "flutter/fml/trace_event.h" #include "impeller/base/validation.h" @@ -86,8 +91,11 @@ static std::vector GetFencesForWaitSet(const WaitSet& set) { void FenceWaiterVK::Main() { fml::Thread::SetCurrentThreadName( fml::Thread::ThreadConfig{"io.flutter.impeller.fence_waiter"}); - +#ifdef FML_OS_ANDROID + // Since this thread mostly waits on fences, it doesn't need to be fast. + fml::RequestAffinity(fml::CpuAffinity::kEfficiency); using namespace std::literals::chrono_literals; +#endif // FML_OS_ANDROID while (true) { // We'll read the terminate_ flag within the lock below. diff --git a/impeller/renderer/backend/vulkan/resource_manager_vk.cc b/impeller/renderer/backend/vulkan/resource_manager_vk.cc index f981321c7115e..e3a2a56569004 100644 --- a/impeller/renderer/backend/vulkan/resource_manager_vk.cc +++ b/impeller/renderer/backend/vulkan/resource_manager_vk.cc @@ -8,6 +8,11 @@ #include "flutter/fml/trace_event.h" #include "fml/logging.h" +#ifdef FML_OS_ANDROID +#include "fml/cpu_affinity.h" +#include "flutter/fml/platform/android/cpu_affinity.h" +#endif // FML_OS_ANDROID + namespace impeller { std::shared_ptr ResourceManagerVK::Create() { @@ -39,6 +44,11 @@ void ResourceManagerVK::Start() { fml::Thread::SetCurrentThreadName( fml::Thread::ThreadConfig{"io.flutter.impeller.resource_manager"}); +#ifdef FML_OS_ANDROID + // While this code calls destructors it doesn't need to be particularly fast with them, + // as long as it doesn't interrupt raster thread. + fml::RequestAffinity(fml::CpuAffinity::kEfficiency); +#endif // FML_OS_ANDROID bool should_exit = false; while (!should_exit) { From 757dffc8545d8f729591b396d59af24d569cab38 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 11:49:05 -0700 Subject: [PATCH 2/6] Adjust worker count. --- fml/platform/android/cpu_affinity.cc | 19 ++++++++++++++++--- fml/platform/android/cpu_affinity.h | 8 ++++++++ runtime/dart_vm.cc | 10 ++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/fml/platform/android/cpu_affinity.cc b/fml/platform/android/cpu_affinity.cc index 737f8204b9b6e..2f1c3d89a85ba 100644 --- a/fml/platform/android/cpu_affinity.cc +++ b/fml/platform/android/cpu_affinity.cc @@ -11,6 +11,7 @@ #include #include #include +#include "flutter/fml/logging.h" namespace fml { @@ -36,15 +37,27 @@ void InitCPUInfo(size_t cpu_count) { gCPUTracker = new CPUSpeedTracker(cpu_speeds); } -bool RequestAffinity(CpuAffinity affinity) { +bool SetUpCPUTracker() { // Populate CPU Info if uninitialized. auto count = std::thread::hardware_concurrency(); std::call_once(gCPUTrackerFlag, [count]() { InitCPUInfo(count); }); - if (gCPUTracker == nullptr) { + if (gCPUTracker == nullptr || !gCPUTracker->IsValid()) { + return false; + } + return true; +} + +std::optional EfficiencyCoreCount() { + if (!SetUpCPUTracker()) { return true; } + auto result = gCPUTracker->GetIndices(CpuAffinity::kEfficiency).size(); + FML_DCHECK(result > 0); + return result; +} - if (!gCPUTracker->IsValid()) { +bool RequestAffinity(CpuAffinity affinity) { + if (!SetUpCPUTracker()) { return true; } diff --git a/fml/platform/android/cpu_affinity.h b/fml/platform/android/cpu_affinity.h index 03c59ad5e9126..1907c083d242a 100644 --- a/fml/platform/android/cpu_affinity.h +++ b/fml/platform/android/cpu_affinity.h @@ -8,6 +8,14 @@ namespace fml { +/// @brief Request count of efficiency cores. +/// +/// Efficiency cores are defined as those with the lowest reported +/// cpu_max_freq. If the CPU speed could not be determined, or if all +/// cores have the same reported speed then this returns std::nullopt. +/// That is, the result will never be 0. +std::optional EfficiencyCoreCount(); + /// @brief Request the given affinity for the current thread. /// /// Returns true if successfull, or if it was a no-op. This function is diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 48715c5cc2eec..ee06ea3b0e3b1 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -29,6 +29,10 @@ #include "third_party/tonic/logging/dart_error.h" #include "third_party/tonic/typed_data/typed_list.h" +#ifdef FML_OS_ANDROID +#include "flutter/fml/platform/android/cpu_affinity.h" +#endif // FML_OS_ANDROID + namespace dart { namespace observatory { @@ -285,7 +289,13 @@ size_t DartVM::GetVMLaunchCount() { DartVM::DartVM(const std::shared_ptr& vm_data, std::shared_ptr isolate_name_server) : settings_(vm_data->GetSettings()), +#ifdef FML_OS_ANDROID + concurrent_message_loop_(fml::ConcurrentMessageLoop::Create( + fml::EfficiencyCoreCount().value_or( + std::thread::hardware_concurrency()))), +#else concurrent_message_loop_(fml::ConcurrentMessageLoop::Create()), +#endif // FML_OS_ANDROID skia_concurrent_executor_( [runner = concurrent_message_loop_->GetTaskRunner()]( const fml::closure& work) { runner->PostTask(work); }), From 42b1e565467ff62f55fa519b2905175210b05fc5 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 11:53:48 -0700 Subject: [PATCH 3/6] format --- impeller/renderer/backend/vulkan/fence_waiter_vk.cc | 6 +++--- .../renderer/backend/vulkan/resource_manager_vk.cc | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc index f1a4a097c2dff..b5089d008208b 100644 --- a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc +++ b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc @@ -9,9 +9,9 @@ #include #ifdef FML_OS_ANDROID -#include "fml/cpu_affinity.h" #include "flutter/fml/platform/android/cpu_affinity.h" -#endif // FML_OS_ANDROID +#include "fml/cpu_affinity.h" +#endif // FML_OS_ANDROID #include "flutter/fml/thread.h" #include "flutter/fml/trace_event.h" @@ -95,7 +95,7 @@ void FenceWaiterVK::Main() { // Since this thread mostly waits on fences, it doesn't need to be fast. fml::RequestAffinity(fml::CpuAffinity::kEfficiency); using namespace std::literals::chrono_literals; -#endif // FML_OS_ANDROID +#endif // FML_OS_ANDROID while (true) { // We'll read the terminate_ flag within the lock below. diff --git a/impeller/renderer/backend/vulkan/resource_manager_vk.cc b/impeller/renderer/backend/vulkan/resource_manager_vk.cc index e3a2a56569004..06de5a321cd9b 100644 --- a/impeller/renderer/backend/vulkan/resource_manager_vk.cc +++ b/impeller/renderer/backend/vulkan/resource_manager_vk.cc @@ -9,9 +9,9 @@ #include "fml/logging.h" #ifdef FML_OS_ANDROID -#include "fml/cpu_affinity.h" #include "flutter/fml/platform/android/cpu_affinity.h" -#endif // FML_OS_ANDROID +#include "fml/cpu_affinity.h" +#endif // FML_OS_ANDROID namespace impeller { @@ -45,10 +45,10 @@ void ResourceManagerVK::Start() { fml::Thread::SetCurrentThreadName( fml::Thread::ThreadConfig{"io.flutter.impeller.resource_manager"}); #ifdef FML_OS_ANDROID - // While this code calls destructors it doesn't need to be particularly fast with them, - // as long as it doesn't interrupt raster thread. + // While this code calls destructors it doesn't need to be particularly fast + // with them, as long as it doesn't interrupt raster thread. fml::RequestAffinity(fml::CpuAffinity::kEfficiency); -#endif // FML_OS_ANDROID +#endif // FML_OS_ANDROID bool should_exit = false; while (!should_exit) { From e37d53976577f029935993f1bf3421a06c0b9730 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 15:13:50 -0700 Subject: [PATCH 4/6] import build_config.h --- fml/cpu_affinity.cc | 29 +++++++++++++++++++ fml/cpu_affinity.h | 18 ++++++++++++ fml/cpu_affinity_unittests.cc | 5 ++++ fml/platform/android/cpu_affinity.cc | 4 +-- fml/platform/android/cpu_affinity.h | 20 +++---------- .../renderer/backend/vulkan/context_vk.cc | 6 ++-- .../backend/vulkan/fence_waiter_vk.cc | 9 +----- .../backend/vulkan/resource_manager_vk.cc | 8 +---- runtime/dart_vm.cc | 9 +----- .../platform/android/android_shell_holder.cc | 2 +- 10 files changed, 65 insertions(+), 45 deletions(-) diff --git a/fml/cpu_affinity.cc b/fml/cpu_affinity.cc index 258a9ee0c68ba..03bf5775e48ff 100644 --- a/fml/cpu_affinity.cc +++ b/fml/cpu_affinity.cc @@ -3,13 +3,42 @@ // found in the LICENSE file. #include "flutter/fml/cpu_affinity.h" +#include "flutter/fml/build_config.h" #include #include #include +#ifdef FML_OS_ANDROID +#include "flutter/fml/platform/android/cpu_affinity.h" +#endif // FML_OS_ANDROID + namespace fml { +std::optional EfficiencyCoreCount() { +#ifdef FML_OS_ANDROID + return AndroidEfficiencyCoreCount(); +#else + return std::nullopt; +#endif +} + +/// @brief Request the given affinity for the current thread. +/// +/// Returns true if successfull, or if it was a no-op. This function is +/// only supported on Android devices. +/// +/// Affinity requests are based on documented CPU speed. This speed data +/// is parsed from cpuinfo_max_freq files, see also: +/// https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt +bool RequestAffinity(CpuAffinity affinity) { +#ifdef FML_OS_ANDROID + return AndroidRequestAffinity(affinity); +#else + return true; +#endif +} + CPUSpeedTracker::CPUSpeedTracker(std::vector data) : cpu_speeds_(std::move(data)) { std::optional max_speed = std::nullopt; diff --git a/fml/cpu_affinity.h b/fml/cpu_affinity.h index 3ea45a4fa3d3b..31b58940a61a1 100644 --- a/fml/cpu_affinity.h +++ b/fml/cpu_affinity.h @@ -27,6 +27,24 @@ enum class CpuAffinity { kNotPerformance, }; +/// @brief Request count of efficiency cores. +/// +/// Efficiency cores are defined as those with the lowest reported +/// cpu_max_freq. If the CPU speed could not be determined, or if all +/// cores have the same reported speed then this returns std::nullopt. +/// That is, the result will never be 0. +std::optional EfficiencyCoreCount(); + +/// @brief Request the given affinity for the current thread. +/// +/// Returns true if successfull, or if it was a no-op. This function is +/// only supported on Android devices. +/// +/// Affinity requests are based on documented CPU speed. This speed data +/// is parsed from cpuinfo_max_freq files, see also: +/// https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt +bool RequestAffinity(CpuAffinity affinity); + struct CpuIndexAndSpeed { // The index of the given CPU. size_t index; diff --git a/fml/cpu_affinity_unittests.cc b/fml/cpu_affinity_unittests.cc index eb2f010bc66d6..8a5c90687ed24 100644 --- a/fml/cpu_affinity_unittests.cc +++ b/fml/cpu_affinity_unittests.cc @@ -12,6 +12,11 @@ namespace fml { namespace testing { +TEST(CpuAffinity, NonAndroidPlatformDefaults) { + ASSERT_FALSE(fml::EfficiencyCoreCount().has_value()); + ASSERT_TRUE(fml::RequestAffinity(fml::CpuAffinity::kEfficiency)); +} + TEST(CpuAffinity, NormalSlowMedFastCores) { auto speeds = {CpuIndexAndSpeed{.index = 0, .speed = 1}, CpuIndexAndSpeed{.index = 1, .speed = 2}, diff --git a/fml/platform/android/cpu_affinity.cc b/fml/platform/android/cpu_affinity.cc index 2f1c3d89a85ba..f7477e97de3b0 100644 --- a/fml/platform/android/cpu_affinity.cc +++ b/fml/platform/android/cpu_affinity.cc @@ -47,7 +47,7 @@ bool SetUpCPUTracker() { return true; } -std::optional EfficiencyCoreCount() { +std::optional AndroidEfficiencyCoreCount() { if (!SetUpCPUTracker()) { return true; } @@ -56,7 +56,7 @@ std::optional EfficiencyCoreCount() { return result; } -bool RequestAffinity(CpuAffinity affinity) { +bool AndroidRequestAffinity(CpuAffinity affinity) { if (!SetUpCPUTracker()) { return true; } diff --git a/fml/platform/android/cpu_affinity.h b/fml/platform/android/cpu_affinity.h index 1907c083d242a..4ce1e7964aef9 100644 --- a/fml/platform/android/cpu_affinity.h +++ b/fml/platform/android/cpu_affinity.h @@ -8,22 +8,10 @@ namespace fml { -/// @brief Request count of efficiency cores. -/// -/// Efficiency cores are defined as those with the lowest reported -/// cpu_max_freq. If the CPU speed could not be determined, or if all -/// cores have the same reported speed then this returns std::nullopt. -/// That is, the result will never be 0. -std::optional EfficiencyCoreCount(); +/// @brief Android specific implementation of EfficiencyCoreCount. +std::optional AndroidEfficiencyCoreCount(); -/// @brief Request the given affinity for the current thread. -/// -/// Returns true if successfull, or if it was a no-op. This function is -/// only supported on Android devices. -/// -/// Affinity requests are based on documented CPU speed. This speed data -/// is parsed from cpuinfo_max_freq files, see also: -/// https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt -bool RequestAffinity(CpuAffinity affinity); +/// @brief Android specific implementation of RequestAffinity. +bool AndroidRequestAffinity(CpuAffinity affinity); } // namespace fml diff --git a/impeller/renderer/backend/vulkan/context_vk.cc b/impeller/renderer/backend/vulkan/context_vk.cc index 4e5f885f909d5..0a7b0db2bfabd 100644 --- a/impeller/renderer/backend/vulkan/context_vk.cc +++ b/impeller/renderer/backend/vulkan/context_vk.cc @@ -8,7 +8,6 @@ #include #include #include -#include "flutter/fml/platform/android/cpu_affinity.h" #endif // FML_OS_ANDROID #include @@ -17,6 +16,7 @@ #include #include +#include "flutter/fml/cpu_affinity.h" #include "flutter/fml/trace_event.h" #include "impeller/base/validation.h" #include "impeller/renderer/backend/vulkan/allocator_vk.h" @@ -131,16 +131,16 @@ void ContextVK::Setup(Settings settings) { raster_message_loop_ = fml::ConcurrentMessageLoop::Create( std::min(4u, std::thread::hardware_concurrency())); -#ifdef FML_OS_ANDROID raster_message_loop_->PostTaskToAllWorkers([]() { // Currently we only use the worker task pool for small parts of a frame // workload, if this changes this setting may need to be adjusted. fml::RequestAffinity(fml::CpuAffinity::kNotPerformance); +#ifdef FML_OS_ANDROID if (::setpriority(PRIO_PROCESS, gettid(), -5) != 0) { FML_LOG(ERROR) << "Failed to set Workers task runner priority"; } - }); #endif // FML_OS_ANDROID + }); auto& dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER; dispatcher.init(settings.proc_address_callback); diff --git a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc index b5089d008208b..ef906f869af2c 100644 --- a/impeller/renderer/backend/vulkan/fence_waiter_vk.cc +++ b/impeller/renderer/backend/vulkan/fence_waiter_vk.cc @@ -8,11 +8,7 @@ #include #include -#ifdef FML_OS_ANDROID -#include "flutter/fml/platform/android/cpu_affinity.h" -#include "fml/cpu_affinity.h" -#endif // FML_OS_ANDROID - +#include "flutter/fml/cpu_affinity.h" #include "flutter/fml/thread.h" #include "flutter/fml/trace_event.h" #include "impeller/base/validation.h" @@ -91,11 +87,8 @@ static std::vector GetFencesForWaitSet(const WaitSet& set) { void FenceWaiterVK::Main() { fml::Thread::SetCurrentThreadName( fml::Thread::ThreadConfig{"io.flutter.impeller.fence_waiter"}); -#ifdef FML_OS_ANDROID // Since this thread mostly waits on fences, it doesn't need to be fast. fml::RequestAffinity(fml::CpuAffinity::kEfficiency); - using namespace std::literals::chrono_literals; -#endif // FML_OS_ANDROID while (true) { // We'll read the terminate_ flag within the lock below. diff --git a/impeller/renderer/backend/vulkan/resource_manager_vk.cc b/impeller/renderer/backend/vulkan/resource_manager_vk.cc index 06de5a321cd9b..55e22e5e2c0ea 100644 --- a/impeller/renderer/backend/vulkan/resource_manager_vk.cc +++ b/impeller/renderer/backend/vulkan/resource_manager_vk.cc @@ -7,11 +7,7 @@ #include "flutter/fml/thread.h" #include "flutter/fml/trace_event.h" #include "fml/logging.h" - -#ifdef FML_OS_ANDROID -#include "flutter/fml/platform/android/cpu_affinity.h" -#include "fml/cpu_affinity.h" -#endif // FML_OS_ANDROID +#include "flutter/fml/cpu_affinity.h" namespace impeller { @@ -44,11 +40,9 @@ void ResourceManagerVK::Start() { fml::Thread::SetCurrentThreadName( fml::Thread::ThreadConfig{"io.flutter.impeller.resource_manager"}); -#ifdef FML_OS_ANDROID // While this code calls destructors it doesn't need to be particularly fast // with them, as long as it doesn't interrupt raster thread. fml::RequestAffinity(fml::CpuAffinity::kEfficiency); -#endif // FML_OS_ANDROID bool should_exit = false; while (!should_exit) { diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index ee06ea3b0e3b1..152a4cd6665ce 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -11,6 +11,7 @@ #include "flutter/common/settings.h" #include "flutter/fml/compiler_specific.h" +#include "flutter/fml/cpu_affinity.h" #include "flutter/fml/logging.h" #include "flutter/fml/mapping.h" #include "flutter/fml/size.h" @@ -29,10 +30,6 @@ #include "third_party/tonic/logging/dart_error.h" #include "third_party/tonic/typed_data/typed_list.h" -#ifdef FML_OS_ANDROID -#include "flutter/fml/platform/android/cpu_affinity.h" -#endif // FML_OS_ANDROID - namespace dart { namespace observatory { @@ -289,13 +286,9 @@ size_t DartVM::GetVMLaunchCount() { DartVM::DartVM(const std::shared_ptr& vm_data, std::shared_ptr isolate_name_server) : settings_(vm_data->GetSettings()), -#ifdef FML_OS_ANDROID concurrent_message_loop_(fml::ConcurrentMessageLoop::Create( fml::EfficiencyCoreCount().value_or( std::thread::hardware_concurrency()))), -#else - concurrent_message_loop_(fml::ConcurrentMessageLoop::Create()), -#endif // FML_OS_ANDROID skia_concurrent_executor_( [runner = concurrent_message_loop_->GetTaskRunner()]( const fml::closure& work) { runner->PostTask(work); }), diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 39aef72727d9d..4ae3c82203bee 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -16,11 +16,11 @@ #include #include +#include "flutter/fml/cpu_affinity.h" #include "flutter/fml/logging.h" #include "flutter/fml/make_copyable.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/native_library.h" -#include "flutter/fml/platform/android/cpu_affinity.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/lib/ui/painting/image_generator_registry.h" #include "flutter/shell/common/rasterizer.h" From f4def602beeb052487302b2aca0fee7b281c1eb9 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 15:14:50 -0700 Subject: [PATCH 5/6] ++ --- impeller/renderer/backend/vulkan/resource_manager_vk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/renderer/backend/vulkan/resource_manager_vk.cc b/impeller/renderer/backend/vulkan/resource_manager_vk.cc index 55e22e5e2c0ea..b719737337f8e 100644 --- a/impeller/renderer/backend/vulkan/resource_manager_vk.cc +++ b/impeller/renderer/backend/vulkan/resource_manager_vk.cc @@ -4,10 +4,10 @@ #include "impeller/renderer/backend/vulkan/resource_manager_vk.h" +#include "flutter/fml/cpu_affinity.h" #include "flutter/fml/thread.h" #include "flutter/fml/trace_event.h" #include "fml/logging.h" -#include "flutter/fml/cpu_affinity.h" namespace impeller { From baaa7008ff7ae89d23b6f88006d585fb1500e9bf Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Tue, 19 Sep 2023 15:21:03 -0700 Subject: [PATCH 6/6] ++ --- fml/cpu_affinity.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fml/cpu_affinity.cc b/fml/cpu_affinity.cc index 03bf5775e48ff..ae759e24c4218 100644 --- a/fml/cpu_affinity.cc +++ b/fml/cpu_affinity.cc @@ -23,14 +23,6 @@ std::optional EfficiencyCoreCount() { #endif } -/// @brief Request the given affinity for the current thread. -/// -/// Returns true if successfull, or if it was a no-op. This function is -/// only supported on Android devices. -/// -/// Affinity requests are based on documented CPU speed. This speed data -/// is parsed from cpuinfo_max_freq files, see also: -/// https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt bool RequestAffinity(CpuAffinity affinity) { #ifdef FML_OS_ANDROID return AndroidRequestAffinity(affinity);