aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.cpp
AgeCommit message (Collapse)Author
2019-12-05CpuCore: Clear exclusive state after doing a run in dynarmic.Fernando Sahmkow
This commit corrects an error in which a Core could remain with an exclusive state after running, leaving space for possible race conditions between changing cores.
2019-11-24kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for ↵bunnei
kernel objects. (#3154) * kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
2019-11-12kernel: Resolve sign conversion warningsLioncash
Uncovered a bug within Thread's SetCoreAndAffinityMask() where an unsigned variable (ideal_core) was being compared against "< 0", which would always be a false condition. We can also get rid of an unused function (GetNextProcessorId) which contained a sign mismatch warning.
2019-10-27scheduler: Mark parameter of AskForReselectionOrMarkRedundant() as constLioncash
This is only compared against, so it can be made const.
2019-10-27scheduler: Silence sign conversion warningsLioncash
2019-10-27scheduler: Initialize class members directly where applicableLioncash
Reduces the overall amount of code.
2019-10-27scheduler: Amend documentation commentsLioncash
Adjusts the formatting of a few of the comments an ensures they get recognized as proper Doxygen comments.
2019-10-15Kernel: Clang FormatFernando Sahmkow
2019-10-15Kernel: Address Feedback.Fernando Sahmkow
2019-10-15Kernel Scheduler: Make sure the global scheduler shutdowns correctly.Fernando Sahmkow
2019-10-15Kernel: Clang FormatFernando Sahmkow
2019-10-15Kernel: Remove global system accessor from WaitObjectFernando Sahmkow
2019-10-15Scheduler: Implement Yield Count and Core migration on Thread Preemption.Fernando Sahmkow
2019-10-15Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection.Fernando Sahmkow
2019-10-15Kernel: Initial implementation of thread preemption.Fernando Sahmkow
2019-10-15Scheduler: Add protections for Yield bombingFernando Sahmkow
In case of redundant yields, the scheduler will now idle the core for it's timeslice, in order to avoid continuously yielding the same thing over and over.
2019-10-15Kernel: Style and CorrectionsFernando Sahmkow
2019-10-15Comment and reorganize the schedulerFernando Sahmkow
2019-10-15Implement a new Core SchedulerFernando Sahmkow
2019-04-07kernel: Handle page table switching within MakeCurrentProcess()Lioncash
Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
2019-03-30kernel/scheduler: Remove unused parameter to AddThread()Lioncash
This was made unused in b404fcdf1443b91ac9994c05ad1fe039fcd9675e, but the parameter itself wasn't removed.
2019-03-30kernel/scheduler: Use deduction guides on mutex locksLioncash
Since C++17, we no longer need to explicitly specify the type of the mutex within the lock_guard. The type system can now deduce these with deduction guides.
2019-03-27Fixes and corrections on formatting.Fernando Sahmkow
2019-03-27Use MultiLevelQueue instead of old ThreadQueueListFernando Sahmkow
2019-03-16core: Move PageTable struct into Common.bunnei
2019-03-15kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interfaceLioncash
Rather than make a global accessor for this sort of thing. We can make it a part of the thread interface itself. This allows getting rid of a hidden global accessor in the kernel code.
2019-03-04kernel/scheduler: Pass in system instance in constructorLioncash
Avoids directly relying on the global system instance and instead makes an arbitrary system instance an explicit dependency on construction. This also allows removing dependencies on some global accessor functions as well.
2019-02-15core_timing: Convert core timing into a classLioncash
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
2018-12-03scheduler: Avoid manual Reschedule callZach Hilman
This will automatically occur anyway when PrepareReschedule is called
2018-12-03scheduler: Only work steal higher priority threads from other coresZach Hilman
2018-12-02svc: Avoid performance-degrading unnecessary rescheduleZach Hilman
2018-11-22scheduler: Add explanations for YieldWith and WithoutLoadBalancingZach Hilman
2018-11-18svc: Implement yield types 0 and -1Zach Hilman
2018-10-26svc: Implement svcGetInfo command 0xF0000002Lioncash
This retrieves: if (curr_thread == handle_thread) { result = total_thread_ticks + (hardware_tick_count - last_context_switch_ticks); } else if (curr_thread == handle_thread && sub_id == current_core_index) { result = hardware_tick_count - last_context_switch_ticks; }
2018-10-10kernel/thread: Use a regular pointer for the owner/current processLioncash
There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
2018-10-04kernel/thread: Make all instance variables privateLioncash
Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
2018-09-30kernel/process: Make data member variables privateLioncash
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
2018-09-25kernel/scheduler: Take ARM_Interface instance by reference in the constructorLioncash
It doesn't make sense to allow a scheduler to be constructed around a null pointer.
2018-08-24core: Namespace all code in the arm subdirectory under the Core namespaceLioncash
Gets all of these types and interfaces out of the global namespace.
2018-08-12scheduler: Make HaveReadyThreads() a const member functionLioncash
This function doesn't modify instance state, so the const qualifier can be added to it.
2018-07-31kernel: Remove unnecessary includesLioncash
Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
2018-07-21Merge pull request #751 from Subv/tpidr_el0bunnei
CPU: Save and restore the TPIDR_EL0 system register on every context switch
2018-07-20CPU: Save and restore the TPIDR_EL0 system register on every context switch.Subv
Note that there's currently a dynarmic bug preventing this register from being written.
2018-07-19thread: Convert ThreadStatus into an enum classLioncash
Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
2018-07-18core/memory, core/hle/kernel: Use std::move where applicableLioncash
Avoids pointless copies
2018-07-16scheduler: Clear exclusive state when switching contextsMerryMage
2018-07-02Rename logging macro back to LOG_*James Rowe
2018-05-10scheduler: Protect scheduling functions with a global mutex.bunnei
2018-04-25kernel: Migrate logging macros to fmt-compatible onesLioncash