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.
This commit is contained in:
Andreas Kling 2021-07-13 19:55:39 +02:00
parent 379bcd26e4
commit e323942623
Notes: sideshowbarker 2024-07-18 09:07:12 +09:00

View file

@ -74,7 +74,7 @@ NonnullRefPtrVector<PhysicalPage> PhysicalRegion::take_contiguous_free_pages(siz
auto order = __builtin_ctz(rounded_page_count);
Optional<PhysicalAddress> 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()) {