1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:25:07 +00:00

Kernel: Refactor MemoryManager to use a Bitmap rather than a Vector

This significantly reduces the pressure on the kernel heap when
allocating a lot of pages.

Previously at about 250MB allocated, the free page list would outgrow
the kernel's heap. Given that there is no longer a page list, this does
not happen.

The next barrier will be the kernel memory used by the page records for
in-use memory. This kicks in at about 1GB.
This commit is contained in:
Conrad Pankoff 2019-06-11 21:13:02 +10:00 committed by Andreas Kling
parent 1a77dfed23
commit aee9317d86
8 changed files with 278 additions and 51 deletions

View file

@ -387,8 +387,8 @@ ByteBuffer procfs$mm(InodeIdentifier)
vmo->name().characters());
}
builder.appendf("VMO count: %u\n", MM.m_vmos.size());
builder.appendf("Free physical pages: %u\n", MM.m_free_physical_pages.size());
builder.appendf("Free supervisor physical pages: %u\n", MM.m_free_supervisor_physical_pages.size());
builder.appendf("Free physical pages: %u\n", MM.user_physical_pages() - MM.user_physical_pages_used());
builder.appendf("Free supervisor physical pages: %u\n", MM.super_physical_pages() - MM.super_physical_pages_used());
return builder.to_byte_buffer();
}
@ -544,10 +544,10 @@ ByteBuffer procfs$memstat(InodeIdentifier)
kmalloc_sum_eternal,
sum_alloc,
sum_free,
MM.user_physical_pages_in_existence() - MM.m_free_physical_pages.size(),
MM.m_free_physical_pages.size(),
MM.super_physical_pages_in_existence() - MM.m_free_supervisor_physical_pages.size(),
MM.m_free_supervisor_physical_pages.size(),
MM.user_physical_pages_used(),
MM.user_physical_pages() - MM.user_physical_pages_used(),
MM.super_physical_pages_used(),
MM.super_physical_pages() - MM.super_physical_pages_used(),
g_kmalloc_call_count,
g_kfree_call_count);
return builder.to_byte_buffer();