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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc buddy allocator improvements + fixes #247

Merged
merged 5 commits into from
Jul 5, 2022
Merged

misc buddy allocator improvements + fixes #247

merged 5 commits into from
Jul 5, 2022

Conversation

hawkw
Copy link
Owner

@hawkw hawkw commented Jul 1, 2022

No description provided.

hawkw added 3 commits July 1, 2022 10:47
Obviously, you can't remove a node from a list that's empty. This commit
adds a `debug_assert!` to ensure this doesn't happen.
This fixes a bug in the buddy allocator where a block's buddy is
calculated wrongly. This resulted in an issue where we tried to remove a
block (which we *believed* was the current block's buddy) from the free
list for that order, but the block was actually on a different free
list.
This changes the `buddy::Alloc` type to have a const generic parameter
for the number of free lists, and construct the free list array
internally. This is much nicer than having to pass in a type
`L: AsRef<[spin::Mutex<List<Free>>]>`.
@hawkw hawkw enabled auto-merge (rebase) July 1, 2022 17:50
hawkw added 2 commits July 5, 2022 08:58
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw merged commit c336a47 into main Jul 5, 2022
@hawkw hawkw deleted the eliza/alloc-panic branch July 5, 2022 16:13
hawkw added a commit that referenced this pull request Jul 5, 2022
Obviously, you can't remove a node from a list that's empty. This commit
adds a `debug_assert!` to ensure this doesn't happen.
hawkw added a commit that referenced this pull request Jul 5, 2022
This fixes a bug in the buddy allocator where a block's buddy is
calculated wrongly. This resulted in an issue where we tried to remove a
block (which we *believed* was the current block's buddy) from the free
list for that order, but the block was actually on a different free
list.
hawkw added a commit that referenced this pull request Jul 5, 2022
This changes the `buddy::Alloc` type to have a const generic parameter
for the number of free lists, and construct the free list array
internally. This is much nicer than having to pass in a type
`L: AsRef<[spin::Mutex<List<Free>>]>`.
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.

None yet

1 participant