summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-09 20:05:04 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-09 20:05:04 +0100
commita22b7f96fc0e06748d6e8593ae0e232ca9e42ab1 (patch)
tree50b792055fce08ffd6a64a15643305d82a1e0a81 /Kernel/VM
parent92b46d9814c81504511b83a43797007bae576e0f (diff)
downloadserenity-a22b7f96fc0e06748d6e8593ae0e232ca9e42ab1.zip
Kernel: Remap all regions referring to a PurgeableVMObject on purge
Otherwise we won't get page faults next time you try to access the purged memory.
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/PurgeableVMObject.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Kernel/VM/PurgeableVMObject.cpp b/Kernel/VM/PurgeableVMObject.cpp
index 605d3a5be5..d06b27a901 100644
--- a/Kernel/VM/PurgeableVMObject.cpp
+++ b/Kernel/VM/PurgeableVMObject.cpp
@@ -1,5 +1,6 @@
-#include <Kernel/VM/PurgeableVMObject.h>
+#include <Kernel/VM/MemoryManager.h>
#include <Kernel/VM/PhysicalPage.h>
+#include <Kernel/VM/PurgeableVMObject.h>
NonnullRefPtr<PurgeableVMObject> PurgeableVMObject::create_with_size(size_t size)
{
@@ -37,5 +38,10 @@ int PurgeableVMObject::purge()
m_physical_pages[i] = nullptr;
}
m_was_purged = true;
+
+ for_each_region([&](auto& region) {
+ region.remap();
+ });
+
return purged_page_count;
}