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 Multiple Arenas per jemalloc Pool #1076

Open
lplewa opened this issue Feb 4, 2025 · 0 comments
Open

Use Multiple Arenas per jemalloc Pool #1076

lplewa opened this issue Feb 4, 2025 · 0 comments

Comments

@lplewa
Copy link
Contributor

lplewa commented Feb 4, 2025

Currently, we use only a single arena per jemalloc pool. However, jemalloc arenas are designed to reduce lock contention. Restricting ourselves to one arena forces all threads to synchronize on the same lock. To alleviate this, we should create multiple arenas per pool—by default, one arena per CPU thread (though whether to strictly match CPU thread count is debatable, see CTL #1036).

A similar approach has already been used in memkind. You can find an example implementation here:
https://github.com/memkind/memkind/blob/fb7de4a5e4cd2c48ccc2aba209d01bb6c9035707/src/memkind_arena.c#L757

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

1 participant