-
Notifications
You must be signed in to change notification settings - Fork 33
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
jemalloc_pool should not require user to link with jemalloc #891
Comments
Just to note here what I mentioned on the UMF Technical meeting:
It would mean that UMF is hardcoded to use a particular version of jemalloc, In the past we heard a lot of concerns from Memkind customers/questions regarding how to force Memkind to use different versions of jemalloc. With the current design of UMF users can just upgrade jemalloc to the required version. But if we link statically then UMF should be rebuilt to use a different version of jemalloc. |
I'm for dynamic linking |
statically link allows use to use CTL macros from jemaloc header - but by looking on the header, there is not a huge amount of macros which looks useful for us, so we should be fine. @pbalcer can to show any examples of jemalloc macros which might be a limiting factor for us if we decide to dynamic link jemaloc with umf. |
I talked with Piotr, and i convinced him that we can go with dynamic link to fix this issue |
@bratpiorka @vinser52 @lplewa @pbalcer there is an issue with Dynamically loading the jemalloc library (using I get the following error now:
See: #919 |
Do not link with the jemalloc library explicitly, but load it dynamically (using dlopen()). Ref: oneapi-src#891 Ref: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@vinser52 @lplewa @pbalcer what do you think of the following combo: |
Fetch jemalloc with cmake option to use different version, and link statically. You approach have an issue that on make install of umf we have to install our version of jemalloc.so, what is not a great idea. |
Do not link with the jemalloc library explicitly, but load it dynamically (using dlopen()). Ref: oneapi-src#891 Ref: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
The main argument for using dlopen was that it'd be possible for users to supplement their own jemalloc from the OS. That is no longer the case, and would require us to explain to users that they need to have a specially built jemalloc with the tls flag. |
The main reason to link dynamically was the following: we remember that Memkind users asked from time to time that they would like to use different version of jemalloc with Memkind. If we cannot reach it we UMF than we can just link statically with particular version of jemalloc. Regarding |
@pbalcer explains almost the same :). I agree that if we are not able to allow users to choose the version of jemalloc than we should just link statically. But we can try the idea that I suggested in my previous comment. |
I would still like to provide the user with a way to rebuild the UMF with the jemalloc sources specified by the user. Is this possible? |
Yeah - we will have a GH link with commit hash - in our cmake - user can just change. We can make also cmake variable to override it, so there is no need to change our files, but i prefer to not do so - we can add it always latter on, if someone will ask us. (we have tooo many variables in our cmake, so we should try to not add new if it is not needed) |
I think @bratpiorka wanted an ability to load |
That unfortunately won't work. The problem is transitive, dlopen would now complain that the jemalloc_proxy library is using too much TLS. |
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following options enabled: --with-jemalloc-prefix=je_ --disable-initial-exec-tls Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following non-default options enabled: --with-jemalloc-prefix=je_ - add je_ prefix to all public APIs --disable-cxx - Disable C++ integration. This will cause new and delete operators implementations to be omitted. --disable-initial-exec-tls - Disable the initial-exec TLS model for jemalloc's internal thread-local storage (on those platforms that support explicit settings). This can allow jemalloc to be dynamically loaded after program startup (e.g. using dlopen). Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
The fix is ready, please review: #941 |
Link statically with custom jemalloc built from sources with the following non-default options enabled: --with-jemalloc-prefix=je_ - add je_ prefix to all public APIs --disable-cxx - Disable C++ integration. This will cause new and delete operators implementations to be omitted. --disable-initial-exec-tls - Disable the initial-exec TLS model for jemalloc's internal thread-local storage (on those platforms that support explicit settings). This can allow jemalloc to be dynamically loaded after program startup (e.g. using dlopen). Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following non-default options enabled: --with-jemalloc-prefix=je_ - add je_ prefix to all public APIs --disable-cxx - Disable C++ integration. This will cause new and delete operators implementations to be omitted. --disable-initial-exec-tls - Disable the initial-exec TLS model for jemalloc's internal thread-local storage (on those platforms that support explicit settings). This can allow jemalloc to be dynamically loaded after program startup (e.g. using dlopen). Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following non-default options enabled: --with-jemalloc-prefix=je_ - add je_ prefix to all public APIs --disable-cxx - Disable C++ integration. This will cause new and delete operators implementations to be omitted. --disable-initial-exec-tls - Disable the initial-exec TLS model for jemalloc's internal thread-local storage (on those platforms that support explicit settings). This can allow jemalloc to be dynamically loaded after program startup (e.g. using dlopen). Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Link statically with custom jemalloc built from sources with the following non-default options enabled: --with-jemalloc-prefix=je_ - add je_ prefix to all public APIs --disable-cxx - Disable C++ integration. This will cause new and delete operators implementations to be omitted. --disable-initial-exec-tls - Disable the initial-exec TLS model for jemalloc's internal thread-local storage (on those platforms that support explicit settings). This can allow jemalloc to be dynamically loaded after program startup (e.g. using dlopen). Fixes: oneapi-src#891 Fixes: oneapi-src#894 Fixes: oneapi-src#903 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Currently user needs to pass
-ljemalloc
linker flag if uses jemalloc pool (jemalloc_pool.a)This is an issue as jemalloc exports malloc, realloc, free symbols, so actually liking with jemalloc overrides system functions.
That is annoying for the user, who don't want to use jmalloc instead of glibc functions.
This is also a problem for proxy lib's threshold #883 as
dlsym(RTLD_NEXT, "malloc");
will return malloc@jemalloc not malloc@glibc. See also #894.to overcome this issue we can:
Not sure what is a better approach.
The text was updated successfully, but these errors were encountered: