summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/scheduler.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* hle: kernel: Rewrite scheduler implementation based on Mesopshere.bunnei2020-12-061-819/+0
|
* hle: kernel: Port KAffinityMask from Mesosphere.bunnei2020-12-061-5/+5
|
* kernel: scheduler: Minor cleanup to remove duplicated code.bunnei2020-11-291-46/+12
|
* hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.bunnei2020-11-291-8/+12
|
* Revert "core: Fix clang build"bunnei2020-10-211-51/+21
|
* core: Fix clang buildLioncash2020-10-181-21/+51
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* core/CMakeLists: Make some warnings errorsLioncash2020-10-131-5/+5
| | | | | | | | | Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
* hle/scheduler: Fix data race in is_context_switch_pendingReinUsesLisp2020-08-261-2/+6
| | | | | | | | | | As reported by tsan, SelectThreads could write to is_context_switch_pending holding a mutex while SwitchToCurrent reads it without holding any. It is assumed that the author didn't want an atomic here, so the code is reordered so that whenever is_context_switch_pending is read inside SwitchToContext, the mutex is locked.
* Merge pull request #4491 from lioncash/unused-varsbunnei2020-08-101-17/+11
|\ | | | | kernel: Remove unused variables
| * kernel: Remove unused variablesLioncash2020-08-051-17/+11
| | | | | | | | Resolves a few compiler warnings.
* | scheduler: Resolve sign conversion warningLioncash2020-08-051-1/+2
|/
* cpu_manager: Mark function getters as staticLioncash2020-07-161-1/+1
| | | | | All these do are return std::function instances of static functions, so these can be used without an instance of the CPU manager.
* core_timing,scheduler: Use std::scoped_lock when possibleReinUsesLisp2020-06-291-11/+10
| | | | | Simplifies the cognitive load of procedures using locks and makes locks safe against exceptions.
* Core/Common: Address Feedback.Fernando Sahmkow2020-06-281-2/+2
|
* Kernel: Correct Host Context on Threads and Scheduler.Fernando Sahmkow2020-06-271-8/+8
|
* Scheduler: Correct Reload/UnloadFernando Sahmkow2020-06-271-3/+4
|
* Thread: Release the ARM Interface on exitting.Fernando Sahmkow2020-06-271-1/+1
|
* General: Move ARM_Interface into Threads.Fernando Sahmkow2020-06-271-7/+5
|
* Scheduler: Correct yielding interaction with SetThreadActivity.Fernando Sahmkow2020-06-271-0/+15
|
* General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running.Fernando Sahmkow2020-06-271-0/+7
|
* Kernel: Rewind on SVC change.Fernando Sahmkow2020-06-271-0/+2
|
* CPU_Manager: Unload/Reload threads on preemption on SingleCoreFernando Sahmkow2020-06-271-0/+42
|
* Scheduler: Set last running time on thread.Fernando Sahmkow2020-06-271-0/+2
|
* Kernel: Corrections to TimeManager, Scheduler and Mutex.Fernando Sahmkow2020-06-271-1/+1
|
* Kernel: Fixes, corrections and asserts to scheduler and different svcs.Fernando Sahmkow2020-06-271-1/+2
|
* Scheduler: Correct yields.Fernando Sahmkow2020-06-271-7/+21
|
* Scheduler: Remove arm_interface lock and a few corrections.Fernando Sahmkow2020-06-271-7/+3
|
* SVC: Correct SetThreadActivity.Fernando Sahmkow2020-06-271-5/+4
|
* Scheduler: Correct locking for hle threads.Fernando Sahmkow2020-06-271-1/+2
|
* Scheduler: Fix HLE Threads on guardFernando Sahmkow2020-06-271-4/+6
|
* Scheduler: Protect on closed threads.Fernando Sahmkow2020-06-271-7/+17
|
* Scheduler: Correct assert.Fernando Sahmkow2020-06-271-4/+2
|
* Core: Correct rebase.Fernando Sahmkow2020-06-271-6/+5
|
* Scheduler: Release old thread fiber before trying to switch to the next thread fiber.Fernando Sahmkow2020-06-271-11/+26
|
* Scheduler: Correct Select Threads Step 2.Fernando Sahmkow2020-06-271-0/+1
|
* Kernel: Corrections to Scheduling.Fernando Sahmkow2020-06-271-13/+13
|
* General: Add AssertsFernando Sahmkow2020-06-271-0/+18
|
* General: Add better safety for JIT use.Fernando Sahmkow2020-06-271-0/+3
|
* SVC: Correct WaitSynchronization, WaitProcessWideKey, SignalProcessWideKey.Fernando Sahmkow2020-06-271-1/+1
|
* SVC: Correct SendSyncRequest.Fernando Sahmkow2020-06-271-0/+9
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-271-119/+296
| | | | | | | This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
* core: Implement separate A32/A64 ARM interfaces.bunnei2020-03-031-9/+12
|
* Scheduler: Inline global scheduler in Scheduler Lock.Fernando Sahmkow2020-02-221-4/+2
|
* Kernel: Correct pending feedback.Fernando Sahmkow2020-02-221-3/+4
|
* Kernel: Address Feedback.Fernando Sahmkow2020-02-221-9/+12
|
* Kernel: Implement Scheduler locksFernando Sahmkow2020-02-221-0/+48
|
* Kernel: Make global scheduler depend on KernelCoreFernando Sahmkow2020-02-221-3/+3
|
* Core: Address FeedbackFernando Sahmkow2020-02-141-2/+2
|
* Core: Set all hardware emulation constants in a single file.Fernando Sahmkow2020-02-121-6/+6
|
* Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow2020-01-261-1/+0
| | | | This commit instends on better naming the new purpose of this classes.
* CpuCore: Clear exclusive state after doing a run in dynarmic.Fernando Sahmkow2019-12-051-1/+0
| | | | | | 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.
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei2019-11-251-5/+5
| | | | | | * 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.
* kernel: Resolve sign conversion warningsLioncash2019-11-121-23/+23
| | | | | | | | | 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.
* scheduler: Mark parameter of AskForReselectionOrMarkRedundant() as constLioncash2019-10-281-4/+4
| | | | This is only compared against, so it can be made const.
* scheduler: Silence sign conversion warningsLioncash2019-10-281-5/+5
|
* scheduler: Initialize class members directly where applicableLioncash2019-10-281-5/+3
| | | | Reduces the overall amount of code.
* scheduler: Amend documentation commentsLioncash2019-10-281-29/+0
| | | | | Adjusts the formatting of a few of the comments an ensures they get recognized as proper Doxygen comments.
* Kernel: Clang FormatFernando Sahmkow2019-10-151-1/+1
|
* Kernel: Address Feedback.Fernando Sahmkow2019-10-151-6/+47
|
* Kernel Scheduler: Make sure the global scheduler shutdowns correctly.Fernando Sahmkow2019-10-151-0/+8
|
* Kernel: Clang FormatFernando Sahmkow2019-10-151-1/+2
|
* Kernel: Remove global system accessor from WaitObjectFernando Sahmkow2019-10-151-1/+1
|
* Scheduler: Implement Yield Count and Core migration on Thread Preemption.Fernando Sahmkow2019-10-151-5/+76
|
* Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection.Fernando Sahmkow2019-10-151-7/+7
|
* Kernel: Initial implementation of thread preemption.Fernando Sahmkow2019-10-151-0/+10
|
* Scheduler: Add protections for Yield bombingFernando Sahmkow2019-10-151-7/+9
| | | | | | 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.
* Kernel: Style and CorrectionsFernando Sahmkow2019-10-151-30/+48
|
* Comment and reorganize the schedulerFernando Sahmkow2019-10-151-93/+71
|
* Implement a new Core SchedulerFernando Sahmkow2019-10-151-155/+294
|
* kernel: Handle page table switching within MakeCurrentProcess()Lioncash2019-04-071-1/+0
| | | | | Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
* kernel/scheduler: Remove unused parameter to AddThread()Lioncash2019-03-301-1/+1
| | | | | This was made unused in b404fcdf1443b91ac9994c05ad1fe039fcd9675e, but the parameter itself wasn't removed.
* kernel/scheduler: Use deduction guides on mutex locksLioncash2019-03-301-8/+8
| | | | | | 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.
* Fixes and corrections on formatting.Fernando Sahmkow2019-03-271-6/+9
|
* Use MultiLevelQueue instead of old ThreadQueueListFernando Sahmkow2019-03-271-17/+22
|
* core: Move PageTable struct into Common.bunnei2019-03-171-1/+1
|
* kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interfaceLioncash2019-03-161-4/+2
| | | | | | 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.
* kernel/scheduler: Pass in system instance in constructorLioncash2019-03-041-7/+7
| | | | | | | | 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.
* core_timing: Convert core timing into a classLioncash2019-02-161-1/+1
| | | | | | | | | | | 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.
* core_timing: Rename CoreTiming namespace to Core::TimingLioncash2019-02-121-1/+1
| | | | | | 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.
* scheduler: Avoid manual Reschedule callZach Hilman2018-12-041-10/+8
| | | This will automatically occur anyway when PrepareReschedule is called
* scheduler: Only work steal higher priority threads from other coresZach Hilman2018-12-031-21/+17
|
* svc: Avoid performance-degrading unnecessary rescheduleZach Hilman2018-12-021-1/+2
|
* scheduler: Add explanations for YieldWith and WithoutLoadBalancingZach Hilman2018-11-221-4/+57
|
* svc: Implement yield types 0 and -1Zach Hilman2018-11-191-0/+18
|
* svc: Implement svcGetInfo command 0xF0000002Lioncash2018-10-261-3/+25
| | | | | | | | | | 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; }
* kernel/thread: Use a regular pointer for the owner/current processLioncash2018-10-101-4/+4
| | | | | | | | | | | 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).
* kernel/thread: Make all instance variables privateLioncash2018-10-041-18/+18
| | | | | | | | | | | | | | | | | | | | 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.
* kernel/process: Make data member variables privateLioncash2018-09-301-1/+1
| | | | | | | 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.
* kernel/scheduler: Take ARM_Interface instance by reference in the constructorLioncash2018-09-251-7/+7
| | | | | It doesn't make sense to allow a scheduler to be constructed around a null pointer.
* core: Namespace all code in the arm subdirectory under the Core namespaceLioncash2018-08-251-1/+1
| | | | Gets all of these types and interfaces out of the global namespace.
* scheduler: Make HaveReadyThreads() a const member functionLioncash2018-08-121-1/+1
| | | | | This function doesn't modify instance state, so the const qualifier can be added to it.
* kernel: Remove unnecessary includesLioncash2018-07-311-0/+4
| | | | | Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
* Merge pull request #751 from Subv/tpidr_el0bunnei2018-07-211-0/+3
|\ | | | | CPU: Save and restore the TPIDR_EL0 system register on every context switch
| * CPU: Save and restore the TPIDR_EL0 system register on every context switch.Subv2018-07-211-0/+3
| | | | | | | | Note that there's currently a dynarmic bug preventing this register from being written.
* | thread: Convert ThreadStatus into an enum classLioncash2018-07-201-8/+8
|/ | | | | Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
* core/memory, core/hle/kernel: Use std::move where applicableLioncash2018-07-191-1/+3
| | | | Avoids pointless copies
* scheduler: Clear exclusive state when switching contextsMerryMage2018-07-161-0/+1
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-3/+3
|
* scheduler: Protect scheduling functions with a global mutex.bunnei2018-05-111-0/+15
|
* kernel: Migrate logging macros to fmt-compatible onesLioncash2018-04-261-3/+3
|
* core: Move process creation out of global state.bunnei2018-03-141-3/+4
|
* scheduler: Cleanup based on PR feedback.bunnei2018-02-191-1/+1
|
* kernel: Add Scheduler, which encapsulates the scheduling loading from Thread module.bunnei2018-02-181-0/+134