]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdkfd: Page aligned memory reserve size
authorPhilip Yang <Philip.Yang@amd.com>
Mon, 9 Jan 2023 23:08:17 +0000 (18:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:55 +0000 (09:33 +0100)
commit82a6debd4e4b98dabd99ab26a23553276559d509
tree7448ab034694567a0f8a8add894ea7fc9dead31a
parent12003ad0f35c946e8e05a8ed9069486ec36c6694
drm/amdkfd: Page aligned memory reserve size

[ Upstream commit 0c2dece8fb541ab07b68c3312a1065fa9c927a81 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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