Skip to content
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

Optimize creation of the memory heap #178

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

msft-jlange
Copy link
Collaborator

When the heap free list is first constructed, the list of pages is divided into a region of free page groups, one of which is aligned to a multiple of the size of the maximum free order, and the others are unaligned head/tail regions. The aligned group is freed directly to the maximum order bucket, which avoids the need to do neighbor searching in order to construct the large buckets. No similar optimization is performed on intermediate sizes of the unaligned head/tail regions because they are too small to worry about.

src/mm/alloc.rs Outdated Show resolved Hide resolved
Signed-off-by: Jon Lange <jlange@microsoft.com>
Comment on lines +685 to +686
self.free_page_raw(i, MAX_ORDER - 1);
self.mark_compound_page(i, MAX_ORDER - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good now.

@joergroedel joergroedel merged commit 3ea61eb into coconut-svsm:main Dec 15, 2023
2 checks passed
@msft-jlange msft-jlange deleted the heapopt branch December 15, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants