Skip to content

Commit 83fbee9

Browse files
committed
Refactor smsc/xpmem reg cache to use find() instead of iterate()
Signed-off-by: George Katevenis <gkatev@ics.forth.gr>
1 parent 7a5e9c5 commit 83fbee9

File tree

3 files changed

+136
-137
lines changed

3 files changed

+136
-137
lines changed

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)