Jemalloc : Enable tls_model("initial-exec")#263
Merged
johnhaddon merged 1 commit intoGafferHQ:8_maintenancefrom May 14, 2024
Merged
Jemalloc : Enable tls_model("initial-exec")#263johnhaddon merged 1 commit intoGafferHQ:8_maintenancefrom
tls_model("initial-exec")#263johnhaddon merged 1 commit intoGafferHQ:8_maintenancefrom
Conversation
This avoids the potential of infinite recursion with dynamic TLS on modern glibc versions, as noted here: https://lists.gnu.org/archive/html/info-gnu/2024-01/msg00017.html ``` The dynamic linker calls the malloc and free functions in more cases during TLS access if a shared object with dynamic TLS is loaded and unloaded. This can result in an infinite recursion if a malloc replacement library or its dependencies use dynamic TLS instead of initial-exec TLS. ``` The patch is based on the below commit for Jemalloc 4.0.0, though `configure` is being patched instead of `configure.ac` as we call `configure` directly. jemalloc/jemalloc@f1cf3ea This suggests that `initial-exec` was the intended default but the test has been long broken.
Member
|
LGTM. A bit of reading suggests that I did some limited performance testing to corroborate this, with
That corroborates that this patch is a good thing, that Jemalloc is still a win over default malloc, and also suggests that Jemalloc 5.3.0 might be worth considering in future, with broader testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This avoids the potential of infinite recursion with dynamic TLS on modern glibc versions, as noted here: https://lists.gnu.org/archive/html/info-gnu/2024-01/msg00017.html
I'm not overly clear on the broader ramifications of this change without wider testing, but I've noticed other DCCs that ship Jemalloc 3.6.0 recently providing the same tls-model change for glibc 2.39 compatibility.
The patch is based on the below commit for Jemalloc 4.0.0, though
configureis being patched instead ofconfigure.acas we callconfiguredirectly.jemalloc/jemalloc@f1cf3ea
This suggests that
initial-execwas the intended default but the test has been long broken...