summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-12-20 21:12:32 +0200
committerAndreas Kling <kling@serenityos.org>2020-12-21 00:15:58 +0100
commitafba614d6836092b425e6584df6718b8f4805f02 (patch)
tree89ab53bf3c8d446c264deccc0595453710a148f0 /Kernel
parentb37139e1117cc438aab71dc8acd96809d8127957 (diff)
downloadserenity-afba614d6836092b425e6584df6718b8f4805f02.zip
Kernel: Don't skip if found free page to allocate from a super region
This was a bad pattern that wasn't detected because we only had one super physical region that was initialized by MemoryManager.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/VM/MemoryManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index f1c0c32591..28e975577e 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -571,8 +571,8 @@ NonnullRefPtrVector<PhysicalPage> MemoryManager::allocate_contiguous_supervisor_
for (auto& region : m_super_physical_regions) {
physical_pages = region.take_contiguous_free_pages((count), true);
- if (physical_pages.is_empty())
- continue;
+ if (!physical_pages.is_empty())
+ break;
}
if (physical_pages.is_empty()) {
@@ -598,8 +598,8 @@ RefPtr<PhysicalPage> MemoryManager::allocate_supervisor_physical_page()
for (auto& region : m_super_physical_regions) {
page = region.take_free_page(true);
- if (page.is_null())
- continue;
+ if (!page.is_null())
+ break;
}
if (!page) {