Kernel: Don't take MM lock in MemoryManager::enter_address_space()

We're not accessing any of the MM members here. Also remove some
redundant code to update CR3, since it calls activate_page_directory()
which does exactly the same thing.
This commit is contained in:
Andreas Kling 2022-08-24 12:27:20 +02:00
parent 2607a6a4bd
commit 05156cac94
Notes: sideshowbarker 2024-07-18 05:37:06 +09:00

View file

@ -1018,9 +1018,6 @@ void MemoryManager::enter_address_space(AddressSpace& space)
{ {
auto* current_thread = Thread::current(); auto* current_thread = Thread::current();
VERIFY(current_thread != nullptr); VERIFY(current_thread != nullptr);
SpinlockLocker lock(s_mm_lock);
current_thread->regs().cr3 = space.page_directory().cr3();
activate_page_directory(space.page_directory(), current_thread); activate_page_directory(space.page_directory(), current_thread);
} }