page_allocator: use `RbTree`'s `Entry` API for deallocation
kevinaboos opened this issue · 0 comments
kevinaboos commented
Rather than always inserting a new Chunk
for a dropped AllocatedPages
, we should use the Entry
API instead, which is faster and allows for basically free checks to see if we can eagerly merge the deallocated pages with an existing chunk of pages. This is "free" because it would add no additional overhead beyond inserting a new chunk. In fact, in the case of being able to merge with an existing (contiguously-adjacent) free chunk, it would be significantly faster because no heap allocation would be required for the new chunk.
Relevant code:
Theseus/kernel/page_allocator/src/lib.rs
Line 285 in e43c4e9