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

Eliminate access to thread_local variables in fast-path (like write barrier) #45

Open
EvanKirshenbaum opened this issue Sep 28, 2017 · 0 comments

Comments

@EvanKirshenbaum
Copy link
Collaborator

[imported from HPE issue 250]

We have a couple of places where thread-local variables are accessed in fast-path. This has its own inefficiencies as two function calls are made to access a thread-local.

The only information that we have in write barrier is address of some local variable. Given that, we can implement a lock-free hash-table like data structure, which can store <page#, ptr> pairs. This can happen on the first construction of a thread-local variable, and be cleared up at destruction time.

For lookup, given any local variable address, we mask out the least-significant 12 bits (4K page), and look it up in the structure. If we don't find the entry, then we can create that in the slow-path.

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

No branches or pull requests

1 participant