Kernel: Speed up mmap address space reservation by a lot

Instead of scanning the page table for free range, we not use the
process's mapped regions to find a slot. This speeds up mmap by a lot!
This commit is contained in:
2026-05-20 01:08:08 +03:00
parent 5cb5ae2dfe
commit 4f5f84bb5b
2 changed files with 45 additions and 15 deletions

View File

@@ -278,6 +278,8 @@ namespace Kernel
// You must hold reader end of m_mapped_region_lock when calling this.
size_t find_mapped_region(vaddr_t) const;
BAN::ErrorOr<AddressRange> find_free_address_range(size_t size);
BAN::ErrorOr<VirtualFileSystem::File> find_file(int fd, const char* path, int flags) const;
BAN::ErrorOr<FileParent> find_parent_file(int fd, const char* path, int flags) const;
BAN::ErrorOr<VirtualFileSystem::File> find_relative_parent(int fd, const char* path) const;