diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-23 02:40:16 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-23 03:24:44 +0200 |
commit | 082ed6f417db7f74ba7f09f4d5e82ae288105d46 (patch) | |
tree | 5822c79b887e22020fdee41e05de66ab3e0ba42f /Kernel/Syscalls/purge.cpp | |
parent | 64babcaa83e8885215e79cb6940402b0db80e516 (diff) | |
download | serenity-082ed6f417db7f74ba7f09f4d5e82ae288105d46.zip |
Kernel: Simplify VMObject locking & page fault handlers
This patch greatly simplifies VMObject locking by doing two things:
1. Giving VMObject an IntrusiveList of all its mapping Region objects.
2. Removing VMObject::m_paging_lock in favor of VMObject::m_lock
Before (1), VMObject::for_each_region() was forced to acquire the
global MM lock (since it worked by walking MemoryManager's list of
all regions and checking for regions that pointed to itself.)
With each VMObject having its own list of Regions, VMObject's own
m_lock is all we need.
Before (2), page fault handlers used a separate mutex for preventing
overlapping work. This design required multiple temporary unlocks
and was generally extremely hard to reason about.
Instead, page fault handlers now use VMObject's own m_lock as well.
Diffstat (limited to 'Kernel/Syscalls/purge.cpp')
-rw-r--r-- | Kernel/Syscalls/purge.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Kernel/Syscalls/purge.cpp b/Kernel/Syscalls/purge.cpp index 838459c24c..f12bbe6dda 100644 --- a/Kernel/Syscalls/purge.cpp +++ b/Kernel/Syscalls/purge.cpp @@ -24,7 +24,6 @@ KResultOr<FlatPtr> Process::sys$purge(int mode) NonnullRefPtrVector<AnonymousVMObject> vmobjects; { KResult result(KSuccess); - InterruptDisabler disabler; MM.for_each_vmobject([&](auto& vmobject) { if (vmobject.is_anonymous()) { // In the event that the append fails, only attempt to continue @@ -48,7 +47,6 @@ KResultOr<FlatPtr> Process::sys$purge(int mode) NonnullRefPtrVector<InodeVMObject> vmobjects; { KResult result(KSuccess); - InterruptDisabler disabler; MM.for_each_vmobject([&](auto& vmobject) { if (vmobject.is_inode()) { // In the event that the append fails, only attempt to continue |