From 3053a6237525ae870791eff480812016a3d4ec1e Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 5 Mar 2023 22:27:03 -0500 Subject: [PATCH] core: Promote CPU/GPU threads to time critical And also demote Audren and CoreTiming to High thread priority. --- src/audio_core/renderer/adsp/audio_renderer.cpp | 2 +- src/core/core_timing.cpp | 2 +- src/core/cpu_manager.cpp | 2 +- src/video_core/gpu_thread.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp index 78c15629b..0e437e779 100644 --- a/src/audio_core/renderer/adsp/audio_renderer.cpp +++ b/src/audio_core/renderer/adsp/audio_renderer.cpp @@ -135,7 +135,7 @@ void AudioRenderer::ThreadFunc() { static constexpr char name[]{"AudioRenderer"}; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); - Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); + Common::SetCurrentThreadPriority(Common::ThreadPriority::High); if (mailbox->ADSPWaitMessage() != RenderMessage::AudioRenderer_InitializeOK) { LOG_ERROR(Service_Audio, "ADSP Audio Renderer -- Failed to receive initialize message from host!"); diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 742cfb996..cd4df4522 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -53,7 +53,7 @@ void CoreTiming::ThreadEntry(CoreTiming& instance) { static constexpr char name[] = "HostTiming"; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); - Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); + Common::SetCurrentThreadPriority(Common::ThreadPriority::High); instance.on_thread_init(); instance.ThreadLoop(); MicroProfileOnThreadExit(); diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index 04a11f444..980bb97f9 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp @@ -192,7 +192,7 @@ void CpuManager::RunThread(std::stop_token token, std::size_t core) { } MicroProfileOnThreadCreate(name.c_str()); Common::SetCurrentThreadName(name.c_str()); - Common::SetCurrentThreadPriority(Common::ThreadPriority::High); + Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); auto& data = core_data[core]; data.host_context = Common::Fiber::ThreadToFiber(); diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 9c103c0d4..050b11874 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -25,7 +25,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system, SCOPE_EXIT({ MicroProfileOnThreadExit(); }); Common::SetCurrentThreadName(name.c_str()); - Common::SetCurrentThreadPriority(Common::ThreadPriority::High); + Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); system.RegisterHostThread(); auto current_context = context.Acquire();