-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loader: Improve physical memory mapping performance at startup #113
Comments
I was having a look at the issue and realized there would need to be quite a lot of changes: Just wanted to have your opinion before hacking away. |
First off: heya ✌️ also: the current mapping code is a bit overengineered bc I thought we'd need to support mutating the page table tree which turns out we don't really, so dont hesitate to do bigger sweeping changes if thats needed for faster mapping, no one is emotionally attached to that code :) |
Finally managed to work on superpage support. Unfortunately the virtual and physical memory regions used to call This could be fixed in Is there any other way to make this work? If not, are there any downsides to this approach? |
Hey @alegnani that seems like a totally suitable solution to me, but tbh I don't fully grasp the nuances from just a description so feel free to open a pull request and we could discuss there further ;) at the same time, I have been working on a different implementation in the meantime (bc it was blocking more useful higher level virtmem features) and came up with this #158 (specifically this k23/libs/pmm/src/address_space.rs Line 60 in 12ad8bd
|
The loader automatically maps all of physical memory at a chosen offset in kernel space (for having access to page tables, introspection of the kernels elf file etc).
The current implementation is quite sub-par though as it maps the huge range using the most fine-grained 4k pages (wasting a lot of cycles and memory in the process). Instead we should be mapping with megapages or gigapages (the region allocated by the virt_alloc for mapping is already gigapage-aligned).
Maybe we can even figure out a smart way to map the region using the fewest pages possible by mapping as much as we can using gigapages, then stepping down to megapages and map as much as possible using those and only map using regular pages for the rest of the requested range.
The text was updated successfully, but these errors were encountered: