From c14dda14c4faed4fe6468923f066b2979d2c87f9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 18 Aug 2022 17:36:54 +0200 Subject: [PATCH] Kernel: Add a comment about what the MM lock protects --- Kernel/Memory/MemoryManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index 881422cf52..b623c7ee94 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -58,6 +58,11 @@ ErrorOr page_round_up(FlatPtr x) // run. If we do, then Singleton would get re-initialized, causing // the memory manager to be initialized twice! static MemoryManager* s_the; + +// The MM lock protects: +// - all data members of MemoryManager +// - the quickmap mechanism +// - the PTE/PDE mapping mechanism RecursiveSpinlock s_mm_lock { LockRank::MemoryManager }; MemoryManager& MemoryManager::the()