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.
This commit is contained in:
Andreas Kling 2021-07-13 23:43:31 +02:00
parent eb7b755937
commit 6cc1247395
Notes: sideshowbarker 2024-07-18 09:06:19 +09:00

View File

@ -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);