Fixed the HUGETLB_ALLOCATION option

Setting HUGETLB_ALLOCATION=1 allocates huge page memory
This commit is contained in:
gxw 2024-04-28 01:08:44 +08:00
parent 1031d161f6
commit 5785a17c93
3 changed files with 12 additions and 12 deletions

View File

@ -1590,7 +1590,7 @@ CCOMMON_OPT += -DFUNCTION_PROFILE
endif
ifdef HUGETLB_ALLOCATION
CCOMMON_OPT += -DALLOC_HUGETLB
CCOMMON_OPT += -DALLOC_HUGETLB -DALLOC_SHM
endif
ifdef HUGETLBFILE_ALLOCATION

View File

@ -546,7 +546,7 @@ if (FUNCTION_PROFILE)
endif ()
if (HUGETLB_ALLOCATION)
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB")
set(CCOMMON_OPT "${CCOMMON_OPT} -DALLOC_HUGETLB -DALLOC_SHM")
endif ()
if (DEFINED HUGETLBFILE_ALLOCATION)

View File

@ -964,7 +964,7 @@ static void *alloc_shm(void *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){
@ -1166,12 +1166,12 @@ void *blas_memory_alloc(int procpos){
alloc_devicedirver,
#endif
/* 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
alloc_shm,
#endif
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_MMAP
alloc_mmap,
#endif
@ -2534,7 +2534,7 @@ static void *alloc_shm(void *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){
@ -2763,12 +2763,12 @@ void *blas_memory_alloc(int procpos){
alloc_devicedirver,
#endif
/* 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
alloc_shm,
#endif
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
alloc_hugetlb,
#endif
#ifdef ALLOC_MMAP
alloc_mmap,
#endif
@ -2945,7 +2945,7 @@ void *blas_memory_alloc(int procpos){
}
#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;
#endif
@ -3061,7 +3061,7 @@ allocation2:
}
#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;
#endif