1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

Kernel: Remove global MM lock in favor of SpinlockProtected

Globally shared MemoryManager state is now kept in a GlobalData struct
and wrapped in SpinlockProtected.

A small set of members are left outside the GlobalData struct as they
are only set during boot initialization, and then remain constant.
This allows us to access those members without taking any locks.
This commit is contained in:
Andreas Kling 2022-08-25 16:46:13 +02:00
parent 36225c0ae7
commit a3b2b20782
6 changed files with 470 additions and 456 deletions

View file

@ -261,10 +261,6 @@ void Scheduler::yield()
void Scheduler::context_switch(Thread* thread)
{
if (Memory::s_mm_lock.is_locked_by_current_processor()) {
PANIC("In context switch while holding Memory::s_mm_lock");
}
thread->did_schedule();
auto* from_thread = Thread::current();