diff --git a/src/fmm.c b/src/fmm.c index c9a356d0fd..fa874156b0 100644 --- a/src/fmm.c +++ b/src/fmm.c @@ -714,10 +714,10 @@ static void *mmap_aperture_allocate_aligned(manageable_aperture_t *aper, return NULL; } - /* Align big buffers to the next power-of-2 up to huge page - * size for flexible fragment size TLB optimizations + /* Align big buffers to the next power-of-2 up to 1GB + * size for memory allocation optimization */ - while (align < GPU_HUGE_PAGE_SIZE && size >= (align << 1)) + while (align < GPU_GIANT_PAGE_SIZE && size >= (align << 1)) align <<= 1; /* Add padding to guarantee proper alignment and leave guard diff --git a/src/libhsakmt.h b/src/libhsakmt.h index 9fcd6d66fa..f815e43e99 100644 --- a/src/libhsakmt.h +++ b/src/libhsakmt.h @@ -72,6 +72,7 @@ extern int PAGE_SHIFT; /* 2MB huge page size for 4-level page tables on Vega10 and later GPUs */ #define GPU_HUGE_PAGE_SIZE (2 << 20) +#define GPU_GIANT_PAGE_SIZE (1 << 30) #define CHECK_PAGE_MULTIPLE(x) \ do { if ((uint64_t)PORT_VPTR_TO_UINT64(x) % PAGE_SIZE) return HSAKMT_STATUS_INVALID_PARAMETER; } while(0)