From 785592293cfcc8b0292ea18a61eb5ec436a280d9 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 15 Apr 2024 15:17:38 -0700 Subject: [PATCH] don't use thread affinity for the thread-pool using thread affinity naively on big.little architectures is very flaky, for now it's better to simplify and not use it at all, let the kernel figure things out. BUGS=[333582569] --- libs/utils/src/JobSystem.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libs/utils/src/JobSystem.cpp b/libs/utils/src/JobSystem.cpp index 9473926a54..a519dfda74 100644 --- a/libs/utils/src/JobSystem.cpp +++ b/libs/utils/src/JobSystem.cpp @@ -423,13 +423,9 @@ void JobSystem::loop(ThreadState* state) noexcept { setThreadName("JobSystem::loop"); setThreadPriority(Priority::DISPLAY); - // set a CPU affinity on each of our JobSystem thread to prevent them from jumping from core - // to core. On Android, it looks like the affinity needs to be reset from time to time. - setThreadAffinityById(state->id); - // record our work queue mThreadMapLock.lock(); - bool inserted = mThreadMap.emplace(std::this_thread::get_id(), state).second; + bool const inserted = mThreadMap.emplace(std::this_thread::get_id(), state).second; mThreadMapLock.unlock(); ASSERT_PRECONDITION(inserted, "This thread is already in a loop."); @@ -439,7 +435,6 @@ void JobSystem::loop(ThreadState* state) noexcept { std::unique_lock lock(mWaiterLock); while (!exitRequested() && !hasActiveJobs()) { wait(lock); - setThreadAffinityById(state->id); } } } while (!exitRequested());