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:
parent
a96d76fd90
commit
07425580a8
4 changed files with 14 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue