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

Page allocator enhancements #36

Merged
merged 13 commits into from
Feb 12, 2024
Merged

Page allocator enhancements #36

merged 13 commits into from
Feb 12, 2024

Conversation

wojciechozga
Copy link
Member

This PR aims to improve the quality of page allocator implementation. The eventual goal is to reach an implementation that can be formally verified using RefinedRust.

Current changes include:

  • Renamed memory tracker to page allocator.
  • Reimplemented page allocator internal logic to simplify the reasoning about page token division and allocation.

…r internal logic to simplify the reasoning.

Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com>
@wojciechozga
Copy link
Member Author

@lgaeher please have a look at these changes and let me know what you think. I went for another implementation of the constructor that we discussed offline, i.e., I am using a vector instead of slice. Would that be fine?

We probably should use a sorted collection that stores page tokens due to our implementation of allocation (acquire_continous_pages_of_given_size).

@wojciechozga wojciechozga changed the title Page Allocator improvements Page Allocator enhancements Feb 9, 2024
@wojciechozga wojciechozga changed the title Page Allocator enhancements Page allocator enhancements Feb 9, 2024
@wojciechozga wojciechozga marked this pull request as draft February 9, 2024 13:22
@wojciechozga wojciechozga requested a review from lgaeher February 9, 2024 13:22
Copy link
Collaborator

@lgaeher lgaeher left a comment

Choose a reason for hiding this comment

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

Thanks!
The iteration over the vector in the constructor actually goes via slices, but I think that should be fine to handle, probably. It's definitely easier than dealing with the direct slice we had before.
I've left some minor comments, but otherwise looks good!

@wojciechozga wojciechozga assigned wojciechozga and unassigned lgaeher Feb 9, 2024
wojciechozga and others added 11 commits February 9, 2024 14:49
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
Co-authored-by: Lennard Gäher <33029057+lgaeher@users.noreply.github.com>
… are aligned to their size as required by the riscv spec

Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com>
@wojciechozga wojciechozga marked this pull request as ready for review February 12, 2024 15:25
@wojciechozga
Copy link
Member Author

@lgaeher please have a look. The latest commit introduces the new algorithm for constructing page tokens over the given memory region.

Copy link
Collaborator

@lgaeher lgaeher left a 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!

Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com>
@wojciechozga wojciechozga merged commit f1f27d5 into main Feb 12, 2024
3 of 4 checks passed
@wojciechozga wojciechozga deleted the woz/memory_tracker_fixes branch February 20, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants