Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 69a4041

Browse files
Revert "Widen CPU affinity set." (#53274)
Reverts #53136 b/345642546 shows some massive performance regressions on this patch. i'll rework it so the conditions are only loosened on phones with one fast core.
1 parent 3a92452 commit 69a4041

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

fml/cpu_affinity.cc

-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ CPUSpeedTracker::CPUSpeedTracker(std::vector<CpuIndexAndSpeed> data)
5858
}
5959
if (data.speed == min_speed_value) {
6060
efficiency_.push_back(data.index);
61-
} else {
62-
not_efficiency_.push_back(data.index);
6361
}
6462
}
6563

@@ -79,8 +77,6 @@ const std::vector<size_t>& CPUSpeedTracker::GetIndices(
7977
return efficiency_;
8078
case CpuAffinity::kNotPerformance:
8179
return not_performance_;
82-
case CpuAffinity::kNotEfficiency:
83-
return not_efficiency_;
8480
}
8581
}
8682

fml/cpu_affinity.h

-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ enum class CpuAffinity {
2626

2727
/// @brief Request affinity for all non-performance cores.
2828
kNotPerformance,
29-
30-
/// @brief Request affinity for all non-efficiency cores.
31-
kNotEfficiency,
3229
};
3330

3431
/// @brief Request count of efficiency cores.
@@ -82,7 +79,6 @@ class CPUSpeedTracker {
8279
std::vector<size_t> efficiency_;
8380
std::vector<size_t> performance_;
8481
std::vector<size_t> not_performance_;
85-
std::vector<size_t> not_efficiency_;
8682
};
8783

8884
/// @note Visible for testing.

fml/cpu_affinity_unittests.cc

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ TEST(CpuAffinity, NormalSlowMedFastCores) {
2929
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance).size(), 2u);
3030
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance)[0], 0u);
3131
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotPerformance)[1], 1u);
32-
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotEfficiency).size(), 2u);
33-
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotEfficiency)[0], 1u);
34-
ASSERT_EQ(tracker.GetIndices(CpuAffinity::kNotEfficiency)[1], 2u);
3532
}
3633

3734
TEST(CpuAffinity, NoCpuData) {

shell/platform/android/android_shell_holder.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ static void AndroidPlatformThreadConfigSetter(
4949
break;
5050
}
5151
case fml::Thread::ThreadPriority::kDisplay: {
52-
fml::RequestAffinity(fml::CpuAffinity::kNotEfficiency);
52+
fml::RequestAffinity(fml::CpuAffinity::kPerformance);
5353
if (::setpriority(PRIO_PROCESS, 0, -1) != 0) {
5454
FML_LOG(ERROR) << "Failed to set UI task runner priority";
5555
}
5656
break;
5757
}
5858
case fml::Thread::ThreadPriority::kRaster: {
59-
fml::RequestAffinity(fml::CpuAffinity::kNotEfficiency);
59+
fml::RequestAffinity(fml::CpuAffinity::kPerformance);
6060
// Android describes -8 as "most important display threads, for
6161
// compositing the screen and retrieving input events". Conservatively
6262
// set the raster thread to slightly lower priority than it.

0 commit comments

Comments
 (0)