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