From d2846855261cd10a69524525aee2e7b54e376a28 Mon Sep 17 00:00:00 2001 From: Devendar Bureddy Date: Fri, 18 Dec 2020 09:16:45 +0200 Subject: [PATCH] UCP/MEM_TYPE: Adjust mem type zcopy thresh if user sets UCX_ZCOPY_THRESH --- src/ucp/core/ucp_ep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ucp/core/ucp_ep.c b/src/ucp/core/ucp_ep.c index 344b3bee642..f82882aa598 100644 --- a/src/ucp/core/ucp_ep.c +++ b/src/ucp/core/ucp_ep.c @@ -1499,6 +1499,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i uct_iface_attr_t *iface_attr; size_t it; size_t zcopy_thresh; + size_t mem_type_zcopy_thresh; int mem_type; iface_attr = ucp_worker_iface_get_attr(worker, rsc_index); @@ -1528,6 +1529,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i if (context->config.ext.zcopy_thresh == UCS_MEMUNITS_AUTO) { config->zcopy_auto_thresh = 1; + mem_type_zcopy_thresh = 1; for (it = 0; it < UCP_MAX_IOV; ++it) { zcopy_thresh = ucp_ep_config_get_zcopy_auto_thresh( it + 1, &md_attr->reg_cost, context, @@ -1541,6 +1543,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i config->zcopy_auto_thresh = 0; config->sync_zcopy_thresh[0] = config->zcopy_thresh[0] = ucs_min(context->config.ext.zcopy_thresh, adjust_min_val); + mem_type_zcopy_thresh = config->zcopy_thresh[0]; /* adjust max_short if zcopy_thresh is set externally */ ucp_ep_config_adjust_max_short(&config->max_short, @@ -1551,7 +1554,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i if (UCP_MEM_IS_HOST(mem_type)) { config->mem_type_zcopy_thresh[mem_type] = config->zcopy_thresh[0]; } else if (md_attr->cap.reg_mem_types & UCS_BIT(mem_type)) { - config->mem_type_zcopy_thresh[mem_type] = 1; + config->mem_type_zcopy_thresh[mem_type] = mem_type_zcopy_thresh; } } }