diff options
| author | 2019-09-11 12:14:37 -0400 | |
|---|---|---|
| committer | 2019-10-15 11:55:16 -0400 | |
| commit | 0cf26cee593c3c6abe909f3db52d972f846b13a9 (patch) | |
| tree | 6e8e4b08271d1c3bd2348ef2bdd3cf5c4912dc9f /src/core/hle/kernel/thread.h | |
| parent | Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection. (diff) | |
| download | yuzu-0cf26cee593c3c6abe909f3db52d972f846b13a9.tar.gz yuzu-0cf26cee593c3c6abe909f3db52d972f846b13a9.tar.xz yuzu-0cf26cee593c3c6abe909f3db52d972f846b13a9.zip | |
Scheduler: Implement Yield Count and Core migration on Thread Preemption.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 88255099f..bec23a0e0 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -416,6 +416,14 @@ public: | |||
| 416 | /// Yields this thread and if the core is left idle, loads are rebalanced | 416 | /// Yields this thread and if the core is left idle, loads are rebalanced |
| 417 | bool YieldAndWaitForLoadBalancing(); | 417 | bool YieldAndWaitForLoadBalancing(); |
| 418 | 418 | ||
| 419 | void IncrementYieldCount() { | ||
| 420 | yield_count++; | ||
| 421 | } | ||
| 422 | |||
| 423 | u64 GetYieldCount() const { | ||
| 424 | return yield_count; | ||
| 425 | } | ||
| 426 | |||
| 419 | ThreadSchedStatus GetSchedulingStatus() const { | 427 | ThreadSchedStatus GetSchedulingStatus() const { |
| 420 | return static_cast<ThreadSchedStatus>(scheduling_state & ThreadSchedMasks::LowMask); | 428 | return static_cast<ThreadSchedStatus>(scheduling_state & ThreadSchedMasks::LowMask); |
| 421 | } | 429 | } |
| @@ -460,6 +468,7 @@ private: | |||
| 460 | 468 | ||
| 461 | u64 total_cpu_time_ticks = 0; ///< Total CPU running ticks. | 469 | u64 total_cpu_time_ticks = 0; ///< Total CPU running ticks. |
| 462 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running | 470 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running |
| 471 | u64 yield_count = 0; ///< Number of innecessaries yields occured. | ||
| 463 | 472 | ||
| 464 | s32 processor_id = 0; | 473 | s32 processor_id = 0; |
| 465 | 474 | ||