From f4580fbe0f96c035f4f32b1204597b4bfcef570c Mon Sep 17 00:00:00 2001 From: Troy Mitchell Date: Mon, 10 Nov 2025 17:22:32 +0800 Subject: [PATCH] btl/sm: fix wrong payload_buffer size during freelist_init Previously, freelist_init() used payload_buffer = size + sizeof(btl_sm_frag_t), but what we actually need is size + sizeof(btl_sm_hdr_t). More details can be found in issue(#13404) [1]. (cherry picked from commit f25ff2138e59a67024ce25921a6c73b6c8ae9c52, with conflicts resolved) Link: https://github.com/open-mpi/ompi/issues/13404 [1] Signed-off-by: Troy Mitchell --- opal/mca/btl/sm/btl_sm_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opal/mca/btl/sm/btl_sm_module.c b/opal/mca/btl/sm/btl_sm_module.c index c07a82c960b..4d7f95aa647 100644 --- a/opal/mca/btl/sm/btl_sm_module.c +++ b/opal/mca/btl/sm/btl_sm_module.c @@ -103,7 +103,7 @@ static int sm_btl_first_time_init(mca_btl_sm_t *sm_btl, int n) /* initialize free list for small send and inline fragments */ rc = opal_free_list_init(&component->sm_frags_user, sizeof(mca_btl_sm_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag_t), - mca_btl_sm_component.max_inline_send + sizeof(mca_btl_sm_frag_t), + mca_btl_sm_component.max_inline_send + sizeof(mca_btl_sm_hdr_t), opal_cache_line_size, component->sm_free_list_num, component->sm_free_list_max, component->sm_free_list_inc, component->mpool, 0, NULL, mca_btl_sm_frag_init, @@ -115,7 +115,7 @@ static int sm_btl_first_time_init(mca_btl_sm_t *sm_btl, int n) /* initialize free list for buffered send fragments */ rc = opal_free_list_init(&component->sm_frags_eager, sizeof(mca_btl_sm_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag_t), - mca_btl_sm.super.btl_eager_limit + sizeof(mca_btl_sm_frag_t), + mca_btl_sm.super.btl_eager_limit + sizeof(mca_btl_sm_hdr_t), opal_cache_line_size, component->sm_free_list_num, component->sm_free_list_max, component->sm_free_list_inc, component->mpool, 0, NULL, mca_btl_sm_frag_init, @@ -128,7 +128,7 @@ static int sm_btl_first_time_init(mca_btl_sm_t *sm_btl, int n) /* initialize free list for buffered send fragments */ rc = opal_free_list_init(&component->sm_frags_max_send, sizeof(mca_btl_sm_frag_t), opal_cache_line_size, OBJ_CLASS(mca_btl_sm_frag_t), - mca_btl_sm.super.btl_max_send_size + sizeof(mca_btl_sm_frag_t), + mca_btl_sm.super.btl_max_send_size + sizeof(mca_btl_sm_hdr_t), opal_cache_line_size, component->sm_free_list_num, component->sm_free_list_max, component->sm_free_list_inc, component->mpool, 0, NULL, mca_btl_sm_frag_init,