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