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

Optimize PointerIsMine() for the secondary allocator #75

Closed
hygoni opened this issue Feb 19, 2024 · 3 comments
Closed

Optimize PointerIsMine() for the secondary allocator #75

hygoni opened this issue Feb 19, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request optimization

Comments

@hygoni
Copy link
Owner

hygoni commented Feb 19, 2024

As the commit 30a6aaf in PR #72, the secondary allocator can be optimized in the same way. However, unlike the primary allocator, there is no way to limit address space for the secondary allocator.

The optimization would be to make the secondary allocator to take address space range just like the primary one.

@hygoni hygoni self-assigned this Feb 19, 2024
@hygoni
Copy link
Owner Author

hygoni commented Feb 20, 2024

Just realzing that this approach is not as easy as because mmap() system calls does not support mmap()ing within specific address range :(

Another approach might be to implement own address space allocator and use MAP_FIXED,

...Or just use a map (hashmap, treemap, bitmap, etc.) that translates an address to boolean type 'allocated from the secondary or not'

@hygoni
Copy link
Owner Author

hygoni commented Feb 20, 2024

Another approach might be to implement own address space allocator and use MAP_FIXED,

  • Implement red-black tree or AVL tree in sanitizer_common
  • Implement address space allocator using the RBtree
  • mmap() 2T of VA space first, and mmap(MAP_FIXED) only within that address space

.....and probably (maybe too far?) introduce RCU based balanced tree for better performance.

This is not a small optimization...

@hygoni hygoni added enhancement New feature or request optimization labels Feb 29, 2024
@hygoni
Copy link
Owner Author

hygoni commented Aug 27, 2024

Resolved by METAlloc metadata management scheme

@hygoni hygoni closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request optimization
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant