1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 18:28:10 +00:00

Kernel: Put all Regions on InlineLinkedLists (separated by user/kernel)

Remove the global hash tables and replace them with InlineLinkedLists.
This significantly reduces the kernel heap pressure from doing many
small mmap()'s.
This commit is contained in:
Andreas Kling 2019-08-08 10:53:24 +02:00
parent a96d76fd90
commit 07425580a8
4 changed files with 14 additions and 8 deletions

View file

@ -246,7 +246,7 @@ Region* MemoryManager::kernel_region_from_vaddr(VirtualAddress vaddr)
{
if (vaddr.get() < 0xc0000000)
return nullptr;
for (auto& region : MM.m_kernel_regions) {
for (auto* region = MM.m_kernel_regions.head(); region; region = region->next()) {
if (region->contains(vaddr))
return region;
}
@ -766,9 +766,9 @@ void MemoryManager::register_region(Region& region)
{
InterruptDisabler disabler;
if (region.vaddr().get() >= 0xc0000000)
m_kernel_regions.set(&region);
m_kernel_regions.append(&region);
else
m_user_regions.set(&region);
m_user_regions.append(&region);
}
void MemoryManager::unregister_region(Region& region)