drm/amdkfd: Page aligned memory reserve size
authorPhilip Yang <Philip.Yang@amd.com>
Mon, 9 Jan 2023 23:08:17 +0000 (18:08 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 Jan 2023 21:41:03 +0000 (16:41 -0500)
commit0c2dece8fb541ab07b68c3312a1065fa9c927a81
tree9bc33df388da24fb65dc94cd9c3f9197d487f1bb
parent23b02b0e4678d9d30931eecd5e5dbb06db7f957f
drm/amdkfd: Page aligned memory reserve size

Use page aligned size to reserve memory usage because page aligned TTM
BO size is used to unreserve memory usage, otherwise no page aligned
size causes memory usage accounting unbalanced.

Change vram_used definition type to int64_t to be able to trigger
WARN_ONCE(adev && adev->kfd.vram_used < 0, "..."), to help debug the
accounting issue with warning and backtrace.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c