summaryrefslogtreecommitdiff
path: root/Kernel/VM/MemoryManager.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-08 10:53:24 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-08 11:11:22 +0200
commit07425580a8e293e4fcadf3fc3957f961a8aa8d30 (patch)
treebaaa71d3e664ad9e443deef20c8e6893dbc52844 /Kernel/VM/MemoryManager.cpp
parenta96d76fd907027994d382d99309b7b3af911b8a4 (diff)
downloadserenity-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.cpp6
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(&region);
+ m_kernel_regions.append(&region);
else
- m_user_regions.set(&region);
+ m_user_regions.append(&region);
}
void MemoryManager::unregister_region(Region& region)