OpenMPI  0.1.1
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 
37 {
38  opal_list_item_t super;
40 };
43 
44 /**
45  * The item in the vma_tree itself
46  */
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 
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  */
71  unsigned char* base,
72  unsigned char *bound
73  );
74 /**
75  * Returns all registration that overlaps given memory region
76  */
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  */
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 
uintptr_t end
the bound of the memory range
Definition: rcache_vma_tree.h:51
Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana University Research and Techno...
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
Definition: mpool.h:44
Top-level interface for all MCA components.
Definition: opal_list.h:98
Definition: rcache_vma.h:37
Definition: rcache_vma_tree.h:36
opal_list_t reg_list
list of regs on this vma
Definition: rcache_vma_tree.h:52
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
The item in the vma_tree itself.
Definition: rcache_vma_tree.h:47
uintptr_t start
the base of the memory range
Definition: rcache_vma_tree.h:50
Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana University Research and Techno...
opal_list_t reg_delete_list
delayed deletions list for regs on this vma
Definition: rcache_vma_tree.h:53
Definition: opal_list.h:147
opal_list_item_t super
the parent class
Definition: rcache_vma_tree.h:49
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_module_t * rcache
pointer to rcache vma belongs to
Definition: rcache_vma_tree.h:54
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236