From 6cc12473958d84f2dab8d99371e41c6bafb87b10 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 13 Jul 2021 23:43:31 +0200 Subject: [PATCH] Kernel: Cut allocation size for physical buddy bitmaps in half We were allocating twice as much memory as we needed for these bitmaps due to a silly typo. Found by tomuta trying to boot with 24 GiB of RAM. --- Kernel/VM/PhysicalZone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/VM/PhysicalZone.cpp b/Kernel/VM/PhysicalZone.cpp index 21c209f52ab..180f14fef8c 100644 --- a/Kernel/VM/PhysicalZone.cpp +++ b/Kernel/VM/PhysicalZone.cpp @@ -25,7 +25,7 @@ PhysicalZone::PhysicalZone(PhysicalAddress base_address, size_t page_count) for (int order = max_order; order >= 0; --order) { auto& bucket = m_buckets[order]; size_t block_size = 2u << order; - size_t bitmap_size_for_order = ceil_div((size_t)(chunk_count / block_size), (size_t)1); + size_t bitmap_size_for_order = ceil_div((size_t)(chunk_count / block_size), (size_t)2); bucket.order = order; if (bitmap_size_for_order) bucket.bitmap.grow(bitmap_size_for_order, false);