diff options
author | Tom <tomut@yahoo.com> | 2020-09-01 13:38:50 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-01 22:08:43 +0200 |
commit | eb1cc5d66510b2e10cabf35ec386c72cbf80b49d (patch) | |
tree | d5d8e1aa9b7fe13246368f50bb6b9ff6563d6804 /Kernel | |
parent | 55c4866370ce86d2cf0029304b3a94df0c0c824f (diff) | |
download | serenity-eb1cc5d66510b2e10cabf35ec386c72cbf80b49d.zip |
Kernel: Only remap regions if memory was purged from them
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/VM/PurgeableVMObject.cpp | 9 |
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 (®ion.vmobject() == this) + region.remap(); + }); + } return purged_page_count; } |