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

cache locality project coordination #30

Open
sthalik opened this issue Mar 30, 2016 · 2 comments
Open

cache locality project coordination #30

sthalik opened this issue Mar 30, 2016 · 2 comments

Comments

@sthalik
Copy link
Contributor

sthalik commented Mar 30, 2016

Hey,

Responding to @pasky's earlier request for work regarding struct tree_node cache locality.

The issue is not completely trivial, particularly due to threading and the arbitrary order in which nodes are traversed. This is not merely refactoring.

My best idea is to allocate pages, or several, on a per-thread basis. Get rid of sibling pointer, next sibling can be calculated by parent plus pointer arithmetic of parent->data with regard to given struct tree_node's address. There probably needs to be stored the thread's id as well as a reference count in the page's end or beginning.

Some questions remain, most importantly - can multiple threads add subnodes to the same node?

Another idea is to realloc(3) node's data keeping excess free capacity. But threading again.

@pasky
Copy link
Owner

pasky commented Mar 30, 2016 via email

@sthalik
Copy link
Contributor Author

sthalik commented Apr 15, 2016

@pasky there are two paths, one for fast_malloc after pruning and the second one.

The locality problem you presented before - can it be helped with using per-thread arenas? It's doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants