summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c2
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c19
-rw-r--r--xlators/cluster/dht/src/tier.c20
-rw-r--r--xlators/cluster/ec/src/ec-heald.c2
5 files changed, 24 insertions, 22 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index 08817202b33..74c9bb67931 100644
--- a/xlators/cluster/afr/src/afr-self-heald.c
+++ b/xlators/cluster/afr/src/afr-self-heald.c
@@ -685,7 +685,7 @@ afr_shd_healer_spawn (xlator_t *this, struct subvol_healer *healer,
pthread_cond_signal (&healer->cond);
} else {
ret = gf_thread_create (&healer->thread, NULL,
- threadfn, healer);
+ threadfn, healer, "shdheal");
if (ret)
goto unlock;
healer->running = 1;
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6aa9b13e37a..253fd71068c 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -9290,7 +9290,8 @@ unlock:
run_defrag = 1;
ret = gf_thread_create(&conf->defrag->th,
NULL,
- gf_defrag_start, this);
+ gf_defrag_start, this,
+ "dhtdg");
if (ret) {
GF_FREE (conf->defrag);
conf->defrag = NULL;
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 2e80ada25a3..6a9153f794d 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -3988,8 +3988,9 @@ gf_tier_start_fix_layout (xlator_t *this,
/* Spawn the fix layout thread so that its done in the
* background */
- ret = pthread_create (&tier_fix_layout_arg->thread_id, NULL,
- gf_tier_do_fix_layout, tier_fix_layout_arg);
+ ret = gf_thread_create (&tier_fix_layout_arg->thread_id, NULL,
+ gf_tier_do_fix_layout,
+ tier_fix_layout_arg, "tierfixl");
if (ret) {
gf_log ("tier", GF_LOG_ERROR, "Thread creation failed. "
"Background fix layout for tiering will not "
@@ -4282,6 +4283,7 @@ gf_defrag_start_crawl (void *data)
int err = 0;
int thread_spawn_count = 0;
pthread_t *tid = NULL;
+ char thread_name[GF_THREAD_NAMEMAX] = {0,};
pthread_t filecnt_thread;
gf_boolean_t is_tier_detach = _gf_false;
call_frame_t *statfs_frame = NULL;
@@ -4447,9 +4449,9 @@ gf_defrag_start_crawl (void *data)
"time to complete rebalance.");
}
- ret = pthread_create (&filecnt_thread, NULL,
- &dht_file_counter_thread,
- (void *)defrag);
+ ret = gf_thread_create (&filecnt_thread, NULL,
+ &dht_file_counter_thread,
+ (void *)defrag, "dhtfcnt");
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, ret, 0, "Failed to "
@@ -4491,8 +4493,11 @@ gf_defrag_start_crawl (void *data)
/*Spawn Threads Here*/
while (thread_index < thread_spawn_count) {
- err = pthread_create(&(tid[thread_index]), NULL,
- &gf_defrag_task, (void *)defrag);
+ snprintf (thread_name, sizeof(thread_name),
+ "%s%d", "dhtdf", thread_index + 1);
+ err = gf_thread_create (&(tid[thread_index]), NULL,
+ &gf_defrag_task, (void *)defrag,
+ thread_name);
if (err != 0) {
gf_log ("DHT", GF_LOG_ERROR,
"Thread[%d] creation failed. "
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index c8667228c59..db23b9661bb 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -2577,9 +2577,8 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
demotion_args.is_promotion = _gf_false;
demotion_args.is_compaction = _gf_false;
- ret = pthread_create (&demote_thread,
- NULL, &tier_run,
- &demotion_args);
+ ret = gf_thread_create (&demote_thread,
+ NULL, &tier_run, &demotion_args, "tierdem");
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_LOG_TIER_ERROR,
@@ -2596,9 +2595,8 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
promotion_args.defrag = defrag;
promotion_args.is_promotion = _gf_true;
- ret = pthread_create (&promote_thread,
- NULL, &tier_run,
- &promotion_args);
+ ret = gf_thread_create (&promote_thread, NULL, &tier_run,
+ &promotion_args, "tierpro");
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_LOG_TIER_ERROR,
@@ -2614,9 +2612,8 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
hot_compaction_args.is_compaction = _gf_true;
hot_compaction_args.is_hot_tier = _gf_true;
- ret = pthread_create (&hot_compact_thread,
- NULL, &tier_run,
- &hot_compaction_args);
+ ret = gf_thread_create (&hot_compact_thread, NULL, &tier_run,
+ &hot_compaction_args, "tierhcom");
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_LOG_TIER_ERROR,
@@ -2632,9 +2629,8 @@ tier_start (xlator_t *this, gf_defrag_info_t *defrag)
cold_compaction_args.is_compaction = _gf_true;
cold_compaction_args.is_hot_tier = _gf_false;
- ret = pthread_create (&cold_compact_thread,
- NULL, &tier_run,
- &cold_compaction_args);
+ ret = gf_thread_create (&cold_compact_thread, NULL, &tier_run,
+ &cold_compaction_args, "tierccom");
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_LOG_TIER_ERROR,
diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c
index 2e8ece8e3f7..b4fa6f87189 100644
--- a/xlators/cluster/ec/src/ec-heald.c
+++ b/xlators/cluster/ec/src/ec-heald.c
@@ -442,7 +442,7 @@ ec_shd_healer_spawn (xlator_t *this, struct subvol_healer *healer,
pthread_cond_signal (&healer->cond);
} else {
ret = gf_thread_create (&healer->thread, NULL,
- threadfn, healer);
+ threadfn, healer, "ecshd");
if (ret)
goto unlock;
healer->running = 1;