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

Use SFT for initialize_object_metadata #963

Open
qinsoon opened this issue Sep 26, 2023 · 2 comments · May be fixed by #965
Open

Use SFT for initialize_object_metadata #963

qinsoon opened this issue Sep 26, 2023 · 2 comments · May be fixed by #965
Labels
A-space Area: Space/PageResource C-refactoring Category: Refactoring P-normal Priority: Normal.

Comments

@qinsoon
Copy link
Member

qinsoon commented Sep 26, 2023

Currently we use Allocator.get_space() then invoke initialize_object_metadata on the space. This is the only use fo Allocator.get_space(). As initialize_object_metadata is a function in SFT, we can use SFT to call initialize_object_metadata, and remove Allocator.get_space().

@qinsoon qinsoon added C-refactoring Category: Refactoring A-space Area: Space/PageResource labels Sep 26, 2023
@wks
Copy link
Collaborator

wks commented Sep 26, 2023

Currently this method mainly sets the VO bit of the object. It is performance critical, but (1) the bottleneck is likely to be cache miss rather than function call or virtual dispatch, and (2) if performance is important, the binding needs to inline the VO-bit set operation anyway, and optimise it into a non-atomic bit set (taking advantage of the fact that most bump-pointer allocators give each mutator exclusive access to the page it is allocating into).

So I think it is OK to use SFT to dispatch this operation in order to remove the reference from the allocator to the space. It preserves correctness in the slow path, and makes the code simpler.

@qinsoon
Copy link
Member Author

qinsoon commented Sep 26, 2023

So I think it is OK to use SFT to dispatch this operation in order to remove the reference from the allocator to the space. It preserves correctness in the slow path, and makes the code simpler.

The allocator will still need a reference to the space, as it needs to allocate from the space. But if we use SFT for initialize_object_metadata, we do not need to expose the space to other types by Allocator::get_space().

@qinsoon qinsoon added the P-normal Priority: Normal. label Oct 25, 2023
@qinsoon qinsoon linked a pull request Oct 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-space Area: Space/PageResource C-refactoring Category: Refactoring P-normal Priority: Normal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants