Skip to content

Commit 899afd7

Browse files
authored
Merge pull request #6283 from hppritcha/topic/mpool_6214_to_3.1.x
Update mpool_hugepage_component.c
2 parents 2fd2a12 + aed8c83 commit 899afd7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

opal/mca/mpool/hugepage/mpool_hugepage_component.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,17 @@ static void mca_mpool_hugepage_find_hugepages (void) {
264264

265265
hp->path = strdup (mntent->mnt_dir);
266266
hp->page_size = page_size;
267-
268-
OPAL_OUTPUT_VERBOSE((MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
269-
"found huge page with size = %lu, path = %s, mmap flags = 0x%x",
270-
hp->page_size, hp->path, hp->mmap_flags));
271-
272-
opal_list_append (&mca_mpool_hugepage_component.huge_pages, &hp->super);
267+
268+
if(0 == access (hp->path, R_OK | W_OK)){
269+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
270+
"found huge page with size = %lu, path = %s, mmap flags = 0x%x, adding to list",
271+
hp->page_size, hp->path, hp->mmap_flags);
272+
opal_list_append (&mca_mpool_hugepage_component.huge_pages, &hp->super);
273+
} else {
274+
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
275+
"found huge page with size = %lu, path = %s, mmap flags = 0x%x, with invalid "
276+
"permissions, skipping", hp->page_size, hp->path, hp->mmap_flags);
277+
}
273278
}
274279

275280
opal_list_sort (&mca_mpool_hugepage_component.huge_pages, page_compare);

0 commit comments

Comments
 (0)