mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 15:02:56 +00:00
Kernel: Use AddressSpace region tree for range allocation
This patch stops using VirtualRangeAllocator in AddressSpace and instead looks for holes in the region tree when allocating VM space. There are many benefits: - VirtualRangeAllocator is non-intrusive and would call kmalloc/kfree when used. This new solution is allocation-free. This was a source of unpleasant MM/kmalloc deadlocks. - We consolidate authority on what the address space looks like in a single place. Previously, we had both the range allocator *and* the region tree both being used to determine if an address was valid. Now there is only the region tree. - Deallocation of VM when splitting regions is no longer complicated, as we don't need to keep two separate trees in sync.
This commit is contained in:
parent
90a7b9e5b4
commit
02a95a196f
Notes:
sideshowbarker
2024-07-17 14:31:52 +09:00
Author: https://github.com/awesomekling
Commit: 02a95a196f
10 changed files with 158 additions and 30 deletions
|
@ -17,7 +17,7 @@ ErrorOr<FlatPtr> Process::sys$map_time_page()
|
|||
|
||||
auto& vmobject = TimeManagement::the().time_page_vmobject();
|
||||
|
||||
auto range = TRY(address_space().page_directory().range_allocator().try_allocate_randomized(PAGE_SIZE, PAGE_SIZE));
|
||||
auto range = TRY(address_space().try_allocate_randomized(PAGE_SIZE, PAGE_SIZE));
|
||||
auto* region = TRY(address_space().allocate_region_with_vmobject(range, vmobject, 0, "Kernel time page"sv, PROT_READ, true));
|
||||
return region->vaddr().get();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue