diff options
author | Xavi Hernandez <xhernandez@redhat.com> | 2019-03-05 18:58:20 +0100 |
---|---|---|
committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-07-03 06:25:48 +0000 |
commit | 6697af343dfbe135735a035cbf592b94750bd589 (patch) | |
tree | a8da7bec25c23c135bbd4d06be1257692a8d50e1 /glusterfsd | |
parent | b7b76714691d464b09a6363ccc2783080cb17ea2 (diff) |
core: avoid dynamic TLS allocation when possible
Some interdependencies between logging and memory management functions
make it impossible to use the logging framework before initializing
memory subsystem because they both depend on Thread Local Storage
allocated through pthread_key_create() during initialization.
This causes a crash when we try to log something very early in the
initialization phase.
To prevent this, several dynamically allocated TLS structures have
been replaced by static TLS reserved at compile time using '__thread'
keyword. This also reduces the number of error sources, making
initialization simpler.
Backport of:
> BUG: 1193929
> Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50
> Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Updates: bz#1724210
Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index fc86cbdccc9..7a52313392a 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -2750,8 +2750,6 @@ main(int argc, char *argv[]) }; cmd_args_t *cmd = NULL; - mem_pools_init_early(); - gf_check_and_set_mem_acct(argc, argv); ctx = glusterfs_ctx_new(); @@ -2866,7 +2864,7 @@ main(int argc, char *argv[]) * the parent, but we want to do it as soon as possible after that in * case something else depends on pool allocations. */ - mem_pools_init_late(); + mem_pools_init(); #ifdef GF_LINUX_HOST_OS ret = set_oom_score_adj(ctx); |