libhsakmt: change memory allocation alignment

it is to optimize memory allocation latency, which
changes alignment from 2MB to 1GB.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I7818e9f13b17e2c0992e75b17f978dc03a018a57
This commit is contained in:
Alex Sierra
2020-09-09 15:55:04 -07:00
committed by Eric Huang
parent e28b3fe8b3
commit 973b35bc06
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -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