diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-12-09 20:05:04 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-09 20:05:04 +0100 |
commit | a22b7f96fc0e06748d6e8593ae0e232ca9e42ab1 (patch) | |
tree | 50b792055fce08ffd6a64a15643305d82a1e0a81 /Kernel/VM | |
parent | 92b46d9814c81504511b83a43797007bae576e0f (diff) | |
download | serenity-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.cpp | 8 |
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; } |