Fixed the HUGETLB_ALLOCATION option
Setting HUGETLB_ALLOCATION=1 allocates huge page memory
This commit is contained in:
parent
1031d161f6
commit
5785a17c93
|
@ -1590,7 +1590,7 @@ CCOMMON_OPT += -DFUNCTION_PROFILE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef HUGETLB_ALLOCATION
|
ifdef HUGETLB_ALLOCATION
|
||||||
CCOMMON_OPT += -DALLOC_HUGETLB
|
CCOMMON_OPT += -DALLOC_HUGETLB -DALLOC_SHM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef HUGETLBFILE_ALLOCATION
|
ifdef HUGETLBFILE_ALLOCATION
|
||||||
|
|
|
@ -546,7 +546,7 @@ if (FUNCTION_PROFILE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (HUGETLB_ALLOCATION)
|
if (HUGETLB_ALLOCATION)
|
||||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB")
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB -DALLOC_SHM")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (DEFINED HUGETLBFILE_ALLOCATION)
|
if (DEFINED HUGETLBFILE_ALLOCATION)
|
||||||
|
|
|
@ -964,7 +964,7 @@ static void *alloc_shm(void *address){
|
||||||
return map_address;
|
return map_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
#if (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
|
||||||
|
|
||||||
static void alloc_hugetlb_free(struct alloc_t *alloc_info){
|
static void alloc_hugetlb_free(struct alloc_t *alloc_info){
|
||||||
|
|
||||||
|
@ -1166,12 +1166,12 @@ void *blas_memory_alloc(int procpos){
|
||||||
alloc_devicedirver,
|
alloc_devicedirver,
|
||||||
#endif
|
#endif
|
||||||
/* Hugetlb implicitly assumes ALLOC_SHM */
|
/* Hugetlb implicitly assumes ALLOC_SHM */
|
||||||
|
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
||||||
|
alloc_hugetlb,
|
||||||
|
#endif
|
||||||
#ifdef ALLOC_SHM
|
#ifdef ALLOC_SHM
|
||||||
alloc_shm,
|
alloc_shm,
|
||||||
#endif
|
#endif
|
||||||
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
|
||||||
alloc_hugetlb,
|
|
||||||
#endif
|
|
||||||
#ifdef ALLOC_MMAP
|
#ifdef ALLOC_MMAP
|
||||||
alloc_mmap,
|
alloc_mmap,
|
||||||
#endif
|
#endif
|
||||||
|
@ -2534,7 +2534,7 @@ static void *alloc_shm(void *address){
|
||||||
return map_address;
|
return map_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
#if (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
|
||||||
|
|
||||||
static void alloc_hugetlb_free(struct release_t *release){
|
static void alloc_hugetlb_free(struct release_t *release){
|
||||||
|
|
||||||
|
@ -2763,12 +2763,12 @@ void *blas_memory_alloc(int procpos){
|
||||||
alloc_devicedirver,
|
alloc_devicedirver,
|
||||||
#endif
|
#endif
|
||||||
/* Hugetlb implicitly assumes ALLOC_SHM */
|
/* Hugetlb implicitly assumes ALLOC_SHM */
|
||||||
|
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
||||||
|
alloc_hugetlb,
|
||||||
|
#endif
|
||||||
#ifdef ALLOC_SHM
|
#ifdef ALLOC_SHM
|
||||||
alloc_shm,
|
alloc_shm,
|
||||||
#endif
|
#endif
|
||||||
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
|
||||||
alloc_hugetlb,
|
|
||||||
#endif
|
|
||||||
#ifdef ALLOC_MMAP
|
#ifdef ALLOC_MMAP
|
||||||
alloc_mmap,
|
alloc_mmap,
|
||||||
#endif
|
#endif
|
||||||
|
@ -2945,7 +2945,7 @@ void *blas_memory_alloc(int procpos){
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
|
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
||||||
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3061,7 +3061,7 @@ allocation2:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
|
#if ((defined ALLOC_SHM) && (defined ALLOC_HUGETLB) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
||||||
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue