From b65701a4af41f35a5695a6632e106c046956ff8c Mon Sep 17 00:00:00 2001 From: Seth Zegelstein Date: Mon, 23 Oct 2023 22:58:55 +0000 Subject: [PATCH] prov/util: Fix revert PR #9377 I mistakenly reverted ep->lock to always be an ofi_mutex. Restore ep->lock to depend on domain threading model Signed-off-by: Seth Zegelstein --- prov/util/src/util_ep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prov/util/src/util_ep.c b/prov/util/src/util_ep.c index 61906a9f202..eade45d46db 100644 --- a/prov/util/src/util_ep.c +++ b/prov/util/src/util_ep.c @@ -247,8 +247,9 @@ int ofi_endpoint_init(struct fid_domain *domain, const struct util_prov *util_pr if (util_domain->eq) ofi_ep_bind_eq(ep, util_domain->eq); - /* TODO Figure out how to optimize this lock for rdm and msg endpoints */ - ret = ofi_genlock_init(&ep->lock, OFI_LOCK_MUTEX); + ret = ofi_genlock_init(&ep->lock, + ep->domain->threading != FI_THREAD_SAFE ? + OFI_LOCK_NOOP : OFI_LOCK_MUTEX); if (ret) return ret;