-
Notifications
You must be signed in to change notification settings - Fork 134
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
add clean_up and clean_up_with_filter #264
Conversation
This is a *breaking change*, also add note about safety.
Followup to rust-osdev#259. Code previously merged as part of rust-osdev#227. Signed-off-by: Joe Richey <joerichey@google.com>
I just noticed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, thanks a lot! Two things I noticed:
- Right now this is only implemented for the
MappedPageTable
type (and the derivedOffsetPageTable
), but not for theRecursivePageTable
. If possible, I think it would be a good idea to make the method generic on theMapper
trait and implement it for the recursive page table type too. - What are the use cases for
clean_up_with_filter
method? Its interface is quite complex with the filter function, so I wonder if a simpler interface based on an address range would be better (e.g.clean_up_addr_range
). Or would it be too restricting? (Internally, we could of course still keep the filter-based function, so no change of the implementation would be necessary for this).
@josephlr Perhaps you could take a quick look at this too?
I don't think it's possible to make this generic on I'm not entirely comfortable with recursive page tables just yet, so that's why I haven't implemented anything for them. So I think there are three options:
In your comment on the initial issue (#238) you mention that the user should be able to integrate their own logic, so I tried to make it as customizable as possible. In hindsight I agree that this was perhaps needlessly over engineered. I like the idea of replacing |
EDIT: |
Or maybe not? Still struggling to wrap my head around this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added mostly minor nits, I'm not super familiar with the page-table code of this crate though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very sorry for the long delay on this, @Freax13! This is some great work and I should have reviewed it way sooner.
I added some more comments, otherwise this looks good to me. Given the long delay, I would understand if you don't want to work into this anymore. Please let me know in that case, then I'll try to fix the remaining things myself.
I'm not sure why CI is failing, but I'm pretty sure it's unrelated to this pr. |
Thanks a lot for the quick changes! The CI failure was fixed on master already, so updating your PR to the latest master should fix it. Given that this PR is quite old already, I would recommend to just merge master into your branch instead of attempting a rebase. |
I saw that you no longer use the |
Yeah, I just noticed that as well. We normally only use it for PRs with breaking changes, other changes can be merged directly into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
This pr adds support for deallocating unused page tables.
Closes #238