[kernel] Fix scheduler deadlocks

The scheduler queue locks could deadlock if the timer fired before the
scoped lock destructor ran. Also, reduce lock contention by letting only
one CPU steal work at a time.
This commit is contained in:
Justin C. Miller
2021-07-15 23:32:35 -07:00
parent 37e385e783
commit edfc5ab8b4
2 changed files with 16 additions and 13 deletions

View File

@@ -97,7 +97,7 @@ private:
// TODO: lol a real clock
uint64_t m_clock = 0;
kutil::spinlock m_steal_lock;
unsigned m_steal_turn = 0;
static scheduler *s_instance;
};