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