@@ -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