Skip to content

smsc/xpmem rcache: refactor to use tree find() instead of iterate() #11130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions opal/class/opal_interval_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ static opal_interval_tree_node_t *opal_interval_tree_find_interval(opal_interval
static opal_interval_tree_node_t *
opal_interval_tree_find_node(opal_interval_tree_t *tree, uint64_t low, uint64_t high, void *data)
{
printf("tree find low 0x%lx high 0x%lx\n", low, high);

return opal_interval_tree_find_interval(tree, tree->root.left, low, high, data);
}

Expand Down Expand Up @@ -664,6 +666,8 @@ static void opal_interval_tree_insert_node(opal_interval_tree_t *tree,
opal_interval_tree_node_t *n = parent->left; /* the real root of the tree */
opal_interval_tree_node_t *nill = &tree->nill;

printf("tree insert low 0x%lx high 0x%lx\n", node->low, node->high);

/* set up initial values for the node */
node->color = OPAL_INTERVAL_TREE_COLOR_RED;
node->parent = NULL;
Expand Down
8 changes: 5 additions & 3 deletions opal/mca/btl/sm/btl_sm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* Copyright (c) 2019-2021 Google, Inc. All rights reserved.
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
* Laboratory, ICS Forth. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -437,9 +439,9 @@ void mca_btl_sm_poll_handle_frag(mca_btl_sm_hdr_t *hdr, struct mca_btl_base_endp
.cbdata = reg->cbdata};

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

segments[1].seg_len = hdr->sc_iov.iov_len;
Expand Down
9 changes: 3 additions & 6 deletions opal/mca/smsc/xpmem/smsc_xpmem_component.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2021 Google, Inc. All rights reserved.
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
* Laboratory, ICS Forth. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -76,10 +78,7 @@ static int mca_smsc_xpmem_component_open(void)

static int mca_smsc_xpmem_component_close(void)
{
if (mca_smsc_xpmem_module.vma_module) {
OBJ_RELEASE(mca_smsc_xpmem_module.vma_module);
}

/* nothing to do */
return OPAL_SUCCESS;
}

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

mca_smsc_xpmem_module.vma_module = mca_rcache_base_vma_module_alloc();

return &mca_smsc_xpmem_module.super;
}
8 changes: 4 additions & 4 deletions opal/mca/smsc/xpmem/smsc_xpmem_internal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2021 Google, Inc. All rights reserved.
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
* Laboratory, ICS Forth. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -42,6 +44,8 @@ struct mca_smsc_xpmem_endpoint_t {
xpmem_apid_t apid;
/** maximum address we can attach to on this peer */
uintptr_t address_max;
/** cache of xpmem attachments created using this endpoint */
mca_rcache_base_vma_module_t *vma_module;
};

typedef struct mca_smsc_xpmem_endpoint_t mca_smsc_xpmem_endpoint_t;
Expand All @@ -67,10 +71,6 @@ typedef struct mca_smsc_xpmem_component_t mca_smsc_xpmem_component_t;

struct mca_smsc_xpmem_module_t {
mca_smsc_module_t super;

/** cache of xpmem attachments. this cache holds attachments for all peers. the registrations
* are differentiated by the alloc_base which is set to the endpoint. */
mca_rcache_base_vma_module_t *vma_module;
};

typedef struct mca_smsc_xpmem_module_t mca_smsc_xpmem_module_t;
Expand Down
Loading