Skip to content

Commit 8a6fc59

Browse files
committed
rcache/vma: make rcache lock recursive
There is currently a path through the grdma mpool and vma rcache that leads to deadlock. It happens during the rcache insert. Before the insert the rcache mutex is locked. During the call a new vma item is allocated and then inserted into the rcache tree. The allocation currently goes through the malloc hooks which may (and does) call back into the mpool if the ptmalloc heap needs to be reallocated. This callback tries to lock the rcache mutex which leads to the deadlock. This has been observed with multi-threaded tests and the openib btl. This change may lead to some minor slowdown in the rcache vma when threading is enabled. This will only affect larger message paths in some of the btls. master commit open-mpi/ompi@1d56007 Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 03d50a2 commit 8a6fc59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opal/mca/rcache/vma/rcache_vma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void mca_rcache_vma_module_init( mca_rcache_vma_module_t* rcache ) {
4242
rcache->base.rcache_clean = mca_rcache_vma_clean;
4343
rcache->base.rcache_finalize = mca_rcache_vma_finalize;
4444
rcache->base.rcache_dump_range = mca_rcache_vma_dump_range;
45-
OBJ_CONSTRUCT(&rcache->base.lock, opal_mutex_t);
45+
OBJ_CONSTRUCT(&rcache->base.lock, opal_recursive_mutex_t);
4646
mca_rcache_vma_tree_init(rcache);
4747
}
4848

0 commit comments

Comments
 (0)