summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-09-01 13:38:50 -0600
committerAndreas Kling <kling@serenityos.org>2020-09-01 22:08:43 +0200
commiteb1cc5d66510b2e10cabf35ec386c72cbf80b49d (patch)
treed5d8e1aa9b7fe13246368f50bb6b9ff6563d6804 /Kernel
parent55c4866370ce86d2cf0029304b3a94df0c0c824f (diff)
downloadserenity-eb1cc5d66510b2e10cabf35ec386c72cbf80b49d.zip
Kernel: Only remap regions if memory was purged from them
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/VM/PurgeableVMObject.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Kernel/VM/PurgeableVMObject.cpp b/Kernel/VM/PurgeableVMObject.cpp
index c646af4de0..71eae47e14 100644
--- a/Kernel/VM/PurgeableVMObject.cpp
+++ b/Kernel/VM/PurgeableVMObject.cpp
@@ -82,9 +82,12 @@ int PurgeableVMObject::purge_impl()
}
m_was_purged = true;
- for_each_region([&](auto& region) {
- region.remap();
- });
+ if (purged_page_count > 0) {
+ for_each_region([&](auto& region) {
+ if (&region.vmobject() == this)
+ region.remap();
+ });
+ }
return purged_page_count;
}