233933
From 2bbb097d087bb5ef142775500708f11ccd31bac0 Mon Sep 17 00:00:00 2001
233933
From: Liguang Li <liguang.lee6@gmail.com>
233933
Date: Fri, 21 Jun 2019 12:18:58 +0800
233933
Subject: [PATCH 254/255] Detach iot_worker to release its resources
233933
233933
When iot_worker terminates, its resources have not been reaped, which
233933
will consumes lots of memory.
233933
233933
Detach iot_worker to automically release its resources back to the
233933
system.
233933
233933
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22918/
233933
233933
>fixes: bz#1729107
233933
>Change-Id: I71fabb2940e76ad54dc56b4c41aeeead2644b8bb
233933
>Signed-off-by: Liguang Li <liguang.lee6@gmail.com>
233933
233933
BUG:1729108
233933
Change-Id: I71fabb2940e76ad54dc56b4c41aeeead2644b8bb
233933
Signed-off-by: Liguang Li <liguang.lee6@gmail.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/176106
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
233933
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
233933
---
233933
 xlators/performance/io-threads/src/io-threads.c | 1 +
233933
 1 file changed, 1 insertion(+)
233933
233933
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
233933
index 060d923..1d96691 100644
233933
--- a/xlators/performance/io-threads/src/io-threads.c
233933
+++ b/xlators/performance/io-threads/src/io-threads.c
233933
@@ -835,6 +835,7 @@ __iot_workers_scale(iot_conf_t *conf)
233933
         ret = gf_thread_create(&thread, &conf->w_attr, iot_worker, conf,
233933
                                "iotwr%03hx", conf->curr_count & 0x3ff);
233933
         if (ret == 0) {
233933
+            pthread_detach(thread);
233933
             conf->curr_count++;
233933
             gf_msg_debug(conf->this->name, 0,
233933
                          "scaled threads to %d (queue_size=%d/%d)",
233933
-- 
233933
1.8.3.1
233933