1
1

btl/vader: don't leak registration cache items

Make sure to cleanup the registation cache when removing an
endpoint. This leak only affects systems with XPMEM installed.

Since this is in code specific to XPMEM not sure who could review so
sending it directly to the RM.

cmr=v1.8.2:reviewer=ompi-rm1.8

This commit was SVN r31821.
Этот коммит содержится в:
Nathan Hjelm 2014-05-19 15:16:32 +00:00
родитель deea7b4d7d
Коммит dedf6b377e

Просмотреть файл

@ -218,6 +218,25 @@ static int fini_vader_endpoint (struct mca_btl_base_endpoint_t *ep)
if (NULL != ep->fbox_out) {
#if OMPI_BTL_VADER_HAVE_XPMEM
if (ep->rcache) {
/* clean out the registration cache */
const int nregs = 100;
mca_mpool_base_registration_t *regs[nregs];
int reg_cnt;
do {
reg_cnt = ep->rcache->rcache_find_all(ep->rcache, 0, (size_t)-1,
regs, nregs);
for (int i = 0 ; i < reg_cnt ; ++i) {
/* otherwise dereg will fail on assert */
regs[i]->ref_count = 0;
OBJ_RELEASE(regs[i]);
}
} while (reg_cnt == nregs);
ep->rcache = NULL;
}
xpmem_release (ep->apid);
#else
opal_shmem_segment_detach (&ep->seg_ds);