From e323942623b0e15d9a124f51a739de613119cf1e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 13 Jul 2021 19:55:39 +0200 Subject: [PATCH] Kernel: Only loop through usable zones when allocating >1 physical page We still have to loop here, since a zone can be "usable" while not being able to satisfy a multi-page allocation request. --- Kernel/VM/PhysicalRegion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/VM/PhysicalRegion.cpp b/Kernel/VM/PhysicalRegion.cpp index 61c6301ae5d..6b74058e4cd 100644 --- a/Kernel/VM/PhysicalRegion.cpp +++ b/Kernel/VM/PhysicalRegion.cpp @@ -74,7 +74,7 @@ NonnullRefPtrVector PhysicalRegion::take_contiguous_free_pages(siz auto order = __builtin_ctz(rounded_page_count); Optional page_base; - for (auto& zone : m_zones) { + for (auto& zone : m_usable_zones) { page_base = zone.allocate_block(order); if (page_base.has_value()) { if (zone.is_empty()) {