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