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
Tá an tiomantas seo le fáil i:
tiomanta ag
Eric Huang
tuismitheoir
e28b3fe8b3
tiomantas
973b35bc06
+3
-3
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir