diff options
author | bunnei <bunneidev@gmail.com> | 2017-01-06 06:40:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-06 06:40:39 +0100 |
commit | 1c792389e677ac458696af1903812b5cdc400eab (patch) | |
tree | df7a11197a1d7afd3e4f9fafd207be4ad70b6ac1 | |
parent | Merge pull request #2409 from Subv/unused_funcs (diff) | |
parent | Kernel: Removed the priority boost code for starved threads. (diff) | |
download | yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar.gz yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar.bz2 yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar.lz yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar.xz yuzu-1c792389e677ac458696af1903812b5cdc400eab.tar.zst yuzu-1c792389e677ac458696af1903812b5cdc400eab.zip |
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 7b351ed5e..cb9a93ee4 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -141,28 +141,6 @@ void ArbitrateAllThreads(u32 address) { } } -/// Boost low priority threads (temporarily) that have been starved -static void PriorityBoostStarvedThreads() { - u64 current_ticks = CoreTiming::GetTicks(); - - for (auto& thread : thread_list) { - // TODO(bunnei): Threads that have been waiting to be scheduled for `boost_ticks` (or - // longer) will have their priority temporarily adjusted to 1 higher than the highest - // priority thread to prevent thread starvation. This general behavior has been verified - // on hardware. However, this is almost certainly not perfect, and the real CTR OS scheduler - // should probably be reversed to verify this. - - const u64 boost_timeout = 2000000; // Boost threads that have been ready for > this long - - u64 delta = current_ticks - thread->last_running_ticks; - - if (thread->status == THREADSTATUS_READY && delta > boost_timeout) { - const s32 priority = std::max(ready_queue.get_first()->current_priority - 1, 0); - thread->BoostPriority(priority); - } - } -} - /** * Switches the CPU's active thread context to that of the specified thread * @param new_thread The thread to switch to @@ -196,9 +174,6 @@ static void SwitchContext(Thread* new_thread) { ready_queue.remove(new_thread->current_priority, new_thread); new_thread->status = THREADSTATUS_RUNNING; - // Restores thread to its nominal priority if it has been temporarily changed - new_thread->current_priority = new_thread->nominal_priority; - Core::CPU().LoadContext(new_thread->context); Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); } else { @@ -534,8 +509,6 @@ SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) { } void Reschedule() { - PriorityBoostStarvedThreads(); - Thread* cur = GetCurrentThread(); Thread* next = PopNextReadyThread(); |