Skip to content

Commit 2c0dc9d

Browse files
committed
oshmem/shmem: Fix sshmem start address and warn if inside data region
1 parent 247cfb6 commit 2c0dc9d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

oshmem/mca/memheap/base/memheap_base_static.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "oshmem/proc/proc.h"
1616
#include "oshmem/mca/memheap/memheap.h"
1717
#include "oshmem/mca/memheap/base/base.h"
18+
#include "oshmem/mca/sshmem/base/base.h"
1819
#include "oshmem/util/oshmem_util.h"
1920
#include "opal/util/minmax.h"
2021

@@ -53,6 +54,14 @@ int mca_memheap_base_static_init(mca_memheap_map_t *map)
5354
return OSHMEM_ERROR;
5455
}
5556

57+
#ifdef __linux__
58+
extern unsigned _end;
59+
if (mca_sshmem_base_start_address < (uintptr_t)&_end) {
60+
MEMHEAP_WARN("sshmem base start address is inside data region"
61+
" (%p < %p)", mca_sshmem_base_start_address, &_end);
62+
}
63+
#endif
64+
5665
while (NULL != fgets(line, sizeof(line), fp)) {
5766
if (3 > sscanf(line,
5867
"%llx-%llx %s %llx %s %llx %s",

oshmem/mca/sshmem/base/sshmem_base_open.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
*/
3838
#if UINTPTR_MAX == 0xFFFFFFFF
3939
void *mca_sshmem_base_start_address = (void*)0;
40+
#elif defined(__aarch64__)
41+
void* mca_sshmem_base_start_address = (void*)0xAB0000000000;
4042
#else
4143
void* mca_sshmem_base_start_address = (void*)0xFF000000;
4244
#endif

0 commit comments

Comments
 (0)