Skip to content

Commit 58e54b5

Browse files
authored
Merge pull request #11358 from gkatev/smsc_rcache_find
smsc/xpmem: Refactor reg-cache to use tree's find() instead of iterate()
2 parents 3b6fe68 + b1568d9 commit 58e54b5

File tree

4 files changed

+165
-145
lines changed

4 files changed

+165
-145
lines changed

opal/mca/btl/sm/btl_sm_component.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* Copyright (c) 2019-2021 Google, Inc. All rights reserved.
2525
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
2626
* Copyright (c) 2022 IBM Corporation. All rights reserved.
27+
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
28+
* Laboratory, ICS Forth. All rights reserved.
2729
* $COPYRIGHT$
2830
*
2931
* Additional copyrights may follow
@@ -437,9 +439,9 @@ void mca_btl_sm_poll_handle_frag(mca_btl_sm_hdr_t *hdr, struct mca_btl_base_endp
437439
.cbdata = reg->cbdata};
438440

439441
if (hdr->flags & MCA_BTL_SM_FLAG_SINGLE_COPY) {
440-
void *ctx = MCA_SMSC_CALL(map_peer_region, endpoint->smsc_endpoint, /*flags=*/0,
441-
hdr->sc_iov.iov_base, hdr->sc_iov.iov_len,
442-
&segments[1].seg_addr.pval);
442+
void *ctx = MCA_SMSC_CALL(map_peer_region, endpoint->smsc_endpoint,
443+
MCA_RCACHE_FLAGS_PERSIST, hdr->sc_iov.iov_base,
444+
hdr->sc_iov.iov_len, &segments[1].seg_addr.pval);
443445
assert(NULL != ctx);
444446

445447
segments[1].seg_len = hdr->sc_iov.iov_len;

opal/mca/smsc/xpmem/smsc_xpmem_component.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2021 Google, Inc. All rights reserved.
4+
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
5+
* Laboratory, ICS Forth. All rights reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -76,10 +78,7 @@ static int mca_smsc_xpmem_component_open(void)
7678

7779
static int mca_smsc_xpmem_component_close(void)
7880
{
79-
if (mca_smsc_xpmem_module.vma_module) {
80-
OBJ_RELEASE(mca_smsc_xpmem_module.vma_module);
81-
}
82-
81+
/* nothing to do */
8382
return OPAL_SUCCESS;
8483
}
8584

@@ -161,7 +160,5 @@ static mca_smsc_module_t *mca_smsc_xpmem_component_enable(void)
161160
mca_smsc_xpmem_component.log_attach_align
162161
= opal_min(opal_max(mca_smsc_xpmem_component.log_attach_align, 12), 25);
163162

164-
mca_smsc_xpmem_module.vma_module = mca_rcache_base_vma_module_alloc();
165-
166163
return &mca_smsc_xpmem_module.super;
167164
}

opal/mca/smsc/xpmem/smsc_xpmem_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2021 Google, Inc. All rights reserved.
4+
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
5+
* Laboratory, ICS Forth. All rights reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -42,6 +44,8 @@ struct mca_smsc_xpmem_endpoint_t {
4244
xpmem_apid_t apid;
4345
/** maximum address we can attach to on this peer */
4446
uintptr_t address_max;
47+
/** cache of xpmem attachments created using this endpoint */
48+
mca_rcache_base_vma_module_t *vma_module;
4549
};
4650

4751
typedef struct mca_smsc_xpmem_endpoint_t mca_smsc_xpmem_endpoint_t;
@@ -67,10 +71,6 @@ typedef struct mca_smsc_xpmem_component_t mca_smsc_xpmem_component_t;
6771

6872
struct mca_smsc_xpmem_module_t {
6973
mca_smsc_module_t super;
70-
71-
/** cache of xpmem attachments. this cache holds attachments for all peers. the registrations
72-
* are differentiated by the alloc_base which is set to the endpoint. */
73-
mca_rcache_base_vma_module_t *vma_module;
7474
};
7575

7676
typedef struct mca_smsc_xpmem_module_t mca_smsc_xpmem_module_t;

0 commit comments

Comments
 (0)