OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rcache_vma_tree.h
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /**
3 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2007 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 *
14 * Copyright (c) 2006 Voltaire. All rights reserved.
15 * Copyright (c) 2009 IBM Corporation. All rights reserved.
16 *
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23 /**
24 * @file
25 * Description of the Registration Cache framework
26 */
27 #ifndef MCA_RCACHE_VMA_TREE_H
28 #define MCA_RCACHE_VMA_TREE_H
29 #include "opal/mca/mca.h"
30 #include "ompi/mca/mpool/mpool.h"
31 #include "rcache_vma.h"
32 /*
33 * Data structures for the tree of allocated memory
34 */
35
36 struct mca_rcache_vma_reg_list_item_t
37 {
38 opal_list_item_t super;
39 mca_mpool_base_registration_t *reg;
40 };
41 typedef struct mca_rcache_vma_reg_list_item_t mca_rcache_vma_reg_list_item_t;
42 OBJ_CLASS_DECLARATION(mca_rcache_vma_reg_list_item_t);
43
44 /**
45 * The item in the vma_tree itself
46 */
47 struct mca_rcache_vma_t
48 {
49 opal_list_item_t super; /**< the parent class */
50 uintptr_t start; /**< the base of the memory range */
51 uintptr_t end; /**< the bound of the memory range */
52 opal_list_t reg_list; /**< list of regs on this vma */
53 opal_list_t reg_delete_list; /**< delayed deletions list for regs on this vma */
54 mca_rcache_vma_module_t *rcache; /**< pointer to rcache vma belongs to */
55 };
56 typedef struct mca_rcache_vma_t mca_rcache_vma_t;
57
58 OBJ_CLASS_DECLARATION(mca_rcache_vma_t);
59
60
61 /*
62 * initialize the vma tree
63 */
64 int mca_rcache_vma_tree_init(mca_rcache_vma_module_t* rcache);
65
66 /**
67 * Returns the item in the vma tree
68 */
69 mca_mpool_base_registration_t* mca_rcache_vma_tree_find(
70 mca_rcache_vma_module_t* rcache,
71 unsigned char* base,
72 unsigned char *bound
73 );
74 /**
75 * Returns all registration that overlaps given memory region
76 */
77 int mca_rcache_vma_tree_find_all(
78 mca_rcache_vma_module_t *vma_rcache, unsigned char *base,
79 unsigned char *bound, mca_mpool_base_registration_t **regs,
80 int reg_cnt);
81
82 /*
83 * insert an item in the vma tree
84 */
85 int mca_rcache_vma_tree_insert(mca_rcache_vma_module_t* rcache,
86 mca_mpool_base_registration_t* reg, size_t limit);
87
88 /*
89 * remove an item from the vma tree
90 */
91 int mca_rcache_vma_tree_delete(
92 mca_rcache_vma_module_t* rcache,
93 mca_mpool_base_registration_t* reg
94 );
95
96 /*
97 * Destroy a vma
98 * Do not call this function with rcache lock as it can deadlock
99 */
100 void mca_rcache_vma_destroy(mca_rcache_vma_t *vma);
101
102 #endif /* MCA_RCACHE_VMA_TREE_H */
103
mca_rcache_vma_t::end
uintptr_t end
the bound of the memory range
Definition: rcache_vma_tree.h:51
rcache_vma.h
Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana University Research and Techno...
mca_rcache_vma_tree_find_all
int mca_rcache_vma_tree_find_all(mca_rcache_vma_module_t *vma_rcache, unsigned char *base, unsigned char *bound, mca_mpool_base_registration_t **regs, int reg_cnt)
Returns all registration that overlaps given memory region.
Definition: rcache_vma_tree.c:312
mca_mpool_base_registration_t
Definition: mpool.h:44
mca.h
Top-level interface for all MCA components.
opal_list_item_t
Definition: opal_list.h:98
mca_rcache_vma_module_t
Definition: rcache_vma.h:37
mca_rcache_vma_reg_list_item_t
Definition: rcache_vma_tree.h:36
mca_rcache_vma_t::reg_list
opal_list_t reg_list
list of regs on this vma
Definition: rcache_vma_tree.h:52
mca_rcache_vma_tree_find
mca_mpool_base_registration_t * mca_rcache_vma_tree_find(mca_rcache_vma_module_t *rcache, unsigned char *base, unsigned char *bound)
Returns the item in the vma tree.
Definition: rcache_vma_tree.c:269
mca_rcache_vma_t
The item in the vma_tree itself.
Definition: rcache_vma_tree.h:47
mca_rcache_vma_t::start
uintptr_t start
the base of the memory range
Definition: rcache_vma_tree.h:50
mpool.h
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
mca_rcache_vma_t::reg_delete_list
opal_list_t reg_delete_list
delayed deletions list for regs on this vma
Definition: rcache_vma_tree.h:53
opal_list_t
Definition: opal_list.h:147
mca_rcache_vma_t::super
opal_list_item_t super
the parent class
Definition: rcache_vma_tree.h:49
mca_rcache_vma_tree_delete
int mca_rcache_vma_tree_delete(mca_rcache_vma_module_t *rcache, mca_mpool_base_registration_t *reg)
Function to remove previously memory from the tree without freeing it.
Definition: rcache_vma_tree.c:476
mca_rcache_vma_t::rcache
mca_rcache_vma_module_t * rcache
pointer to rcache vma belongs to
Definition: rcache_vma_tree.h:54
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236