aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
diff options
context:
space:
mode:
authorYifan Zhang <[email protected]>2025-08-20 08:10:51 +0000
committerAlex Deucher <[email protected]>2025-09-09 16:28:28 +0000
commit53503556273a5ead8b75534085e2dcb46e96f883 (patch)
treefdc9a34d2a859e65b875f1e6efecc0b6cfd6763e /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
parentdrm/amdkfd: fix p2p links bug in topology (diff)
downloadkernel-53503556273a5ead8b75534085e2dcb46e96f883.tar.gz
kernel-53503556273a5ead8b75534085e2dcb46e96f883.zip
amd/amdkfd: correct mem limit calculation for small APUs
Current mem limit check leaks some GTT memory (reserved_for_pt reserved_for_ras + adev->vram_pin_size) for small APUs. Since carveout VRAM is tunable on APUs, there are three case regarding the carveout VRAM size relative to GTT: 1. 0 < carveout < gtt apu_prefer_gtt = true, is_app_apu = false 2. carveout > gtt / 2 apu_prefer_gtt = false, is_app_apu = false 3. 0 = carveout apu_prefer_gtt = true, is_app_apu = true It doesn't make sense to check below limitation in case 1 (default case, small carveout) because the values in the below expression are mixed with carveout and gtt. adev->kfd.vram_used[xcp_id] + vram_needed > vram_size - reserved_for_pt - reserved_for_ras - atomic64_read(&adev->vram_pin_size) gtt: kfd.vram_used, vram_needed, vram_size carveout: reserved_for_pt, reserved_for_ras, adev->vram_pin_size In case 1, vram allocation will go to gtt domain, skip vram check since ttm_mem_limit check already cover this allocation. Signed-off-by: Yifan Zhang <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit fa7c99f04f6dd299388e9282812b14e95558ac8e)
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
0 files changed, 0 insertions, 0 deletions