diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-08 10:53:24 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-08 11:11:22 +0200 |
commit | 07425580a8e293e4fcadf3fc3957f961a8aa8d30 (patch) | |
tree | baaa71d3e664ad9e443deef20c8e6893dbc52844 /Kernel/VM/MemoryManager.cpp | |
parent | a96d76fd907027994d382d99309b7b3af911b8a4 (diff) | |
download | serenity-07425580a8e293e4fcadf3fc3957f961a8aa8d30.zip |
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.
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index 143dd6c495..186ec08fbe 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -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(®ion); + m_kernel_regions.append(®ion); else - m_user_regions.set(®ion); + m_user_regions.append(®ion); } void MemoryManager::unregister_region(Region& region) |