Kernel: Always give back VM to the RangeAllocator when unmapping Region
We were only doing this in Process::deallocate_region(), which meant that kernel-only Regions never gave back their VM. With this patch, we can start reusing freed-up address space! :^)
This commit is contained in:
parent
37ba2a7b65
commit
f5ff796970
Notes:
sideshowbarker
2024-07-19 12:50:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f5ff7969702
2 changed files with 1 additions and 1 deletions
Kernel
|
@ -142,7 +142,6 @@ bool Process::deallocate_region(Region& region)
|
|||
InterruptDisabler disabler;
|
||||
for (int i = 0; i < m_regions.size(); ++i) {
|
||||
if (&m_regions[i] == ®ion) {
|
||||
page_directory().range_allocator().deallocate({ region.vaddr(), region.size() });
|
||||
MM.unmap_region(region);
|
||||
m_regions.remove(i);
|
||||
return true;
|
||||
|
|
|
@ -742,6 +742,7 @@ bool MemoryManager::unmap_region(Region& region)
|
|||
dbgprintf("MM: >> Unmapped L%x => P%x <<\n", vaddr, physical_page ? physical_page->paddr().get() : 0);
|
||||
#endif
|
||||
}
|
||||
region.page_directory()->range_allocator().deallocate({ region.vaddr(), region.size() });
|
||||
region.release_page_directory();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue