-
Notifications
You must be signed in to change notification settings - Fork 68
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
Implement frame metadata and refactor most usages of frames #836
Conversation
93fa7b0
to
ae9fe2d
Compare
11fea2e
to
425a76a
Compare
e03c077
to
abc6458
Compare
I may post the justification for some utter changes here: Removal of the
|
d5b257c
to
e0bfeaa
Compare
Most of the code looks good. But the |
8c96390
to
968cfcb
Compare
Because there are two behaviors of a clone in the page table context. The "deep copy" is to allocate a new page and recursively copy all the children; while the "shallow copy" copies the handle and increments the reference count. Implementing the
The concept of handle is good but as the confusion it has brought to you I think further comments in the code is needed. Perhaps there would be naming problems. |
For forgetting and restoring the page handle, the naming is indeed not appropriate. I've renamed them into Also, the For xarray |
87402ee
to
04ae00e
Compare
I am satisfied with the refactored version. |
f1265ba
to
2093886
Compare
In this commit, the frame metadata storage schema is implemented. The bootstrap process is refactored and a boot page table is introduced to perform early stage metadata mapping. The metadata is then used to track `VmFrame`s instead of the former `Arc` approach.
This PR also refactored the page table cursor, distinguishing `Cursor` from `CursorMut`, and split a lot of functions to reduce dynamic condition checking. There are also other sanitizations performed, including refactoring PTE's `is_huge` API to `is_last`, hardening tracked mapping checks, and making `VmFrame` any size.
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.
LGTM. Thanks for the contribution!
Found a patch named
frame_meta_v2.patch
on my pants. Seems that it implements the frame metadata.EDIT: I am trying to make commits in this PR atomic.
FrameMeta
with one counter and use it forVmFrame
;Expose the cursor to the framework user, addressing The APIs of;VmSpace
are vulnerable to race conditions #681Remove;VmFrameVec
VmFrame
toFrame
and refactor;PAGE_SIZE
usagesVmSegment
toSegment
;aster_frame::vm
toaster_frame::mm
;Mark the memory region information in the metadata.EDIT: I am marking the first commit ready for review. I may continue working on the following commits.
EDIT: The page table is improved with the metadata now. However I didn't observe significant performance improvement and it is even slightly worse (the time mapping 273,255 untracked frames (~1G) at a time in release mode is ~73ms compared to original ~56ms). Only the memory usage is improved. I suspect that the original overhead behaves like a cache from reading PTEs.
EDIT: I refactored the cursor. After heavy manual optimization, the time mapping 273,255 untracked frames in release mode dropped from ~73ms to ~42ms, and is faster than the original ~56ms. Yes!
EDIT: I removed some goals of this PR.