From b62edc8442b9705bb2265b4a69a5d9c8819f7eee Mon Sep 17 00:00:00 2001 From: Ashley Pittman Date: Wed, 24 Apr 2024 16:41:46 +0100 Subject: [PATCH] DAOS-623 dfuse: Update dfuse thread names. (#14223) When setting these previously I thought they only appeared in debugger output so they have names which are only meaningful in that context, but the thread names are also visable in ps and top and having a process called "main" does not make sense here. Do not rename the main dfuse thread, and use a dfuse prefix for other thread names. Signed-off-by: Ashley Pittman --- src/client/dfuse/dfuse_core.c | 2 +- src/client/dfuse/dfuse_main.c | 4 ---- src/client/dfuse/dfuse_thread.c | 2 +- src/client/dfuse/inval.c | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client/dfuse/dfuse_core.c b/src/client/dfuse/dfuse_core.c index c1b73544553..dad3a467bff 100644 --- a/src/client/dfuse/dfuse_core.c +++ b/src/client/dfuse/dfuse_core.c @@ -1507,7 +1507,7 @@ dfuse_fs_start(struct dfuse_info *dfuse_info, struct dfuse_cont *dfs) if (rc != 0) D_GOTO(err_threads, rc = daos_errno2der(rc)); - pthread_setname_np(eqt->de_thread, "progress"); + pthread_setname_np(eqt->de_thread, "dfuse progress"); } rc = dfuse_launch_fuse(dfuse_info, &args); diff --git a/src/client/dfuse/dfuse_main.c b/src/client/dfuse/dfuse_main.c index 7bc66125d95..d75656121a5 100644 --- a/src/client/dfuse/dfuse_main.c +++ b/src/client/dfuse/dfuse_main.c @@ -171,7 +171,6 @@ dfuse_bg(struct dfuse_info *dfuse_info) int dfuse_launch_fuse(struct dfuse_info *dfuse_info, struct fuse_args *args) { - pthread_t self; int rc; dfuse_info->di_session = dfuse_session_new(args, dfuse_info); @@ -204,9 +203,6 @@ dfuse_launch_fuse(struct dfuse_info *dfuse_info, struct fuse_args *args) if (rc != -DER_SUCCESS) DFUSE_TRA_ERROR(dfuse_info, "Error sending signal to fg: "DF_RC, DP_RC(rc)); - self = pthread_self(); - pthread_setname_np(self, "main"); - /* Blocking */ if (dfuse_info->di_threaded) rc = dfuse_loop(dfuse_info); diff --git a/src/client/dfuse/dfuse_thread.c b/src/client/dfuse/dfuse_thread.c index d4036a32c58..4e06e4335ce 100644 --- a/src/client/dfuse/dfuse_thread.c +++ b/src/client/dfuse/dfuse_thread.c @@ -93,7 +93,7 @@ start_one(struct dfuse_tm *dtm) D_GOTO(out, rc); } - pthread_setname_np(dt->dt_id, "fuse worker"); + pthread_setname_np(dt->dt_id, "dfuse worker"); d_list_add(&dt->dt_threads, &dtm->tm_threads); diff --git a/src/client/dfuse/inval.c b/src/client/dfuse/inval.c index 104bc21a591..740d1eb52e6 100644 --- a/src/client/dfuse/inval.c +++ b/src/client/dfuse/inval.c @@ -294,7 +294,7 @@ ival_thread_start(struct dfuse_info *dfuse_info) rc = pthread_create(&ival_thread, NULL, ival_thread_fn, NULL); if (rc != 0) goto out; - pthread_setname_np(ival_thread, "invalidator"); + pthread_setname_np(ival_thread, "dfuse inval"); out: return rc;