drm/amdgpu: generally allow over-commit during BO allocation
authorChristian König <christian.koenig@amd.com>
Thu, 24 Nov 2022 07:26:40 +0000 (08:26 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2022 15:17:24 +0000 (10:17 -0500)
commitf9d00a4a8dc8fff951c97b3213f90d6bc7a72175
treeb674071d97c95e3b57706a9345b7c48f4f8961b5
parent6ee31b3a4f596aba5123fca2776df316c20f7b06
drm/amdgpu: generally allow over-commit during BO allocation

We already fallback to a dummy BO with no backing store when we
allocate GDS,GWS and OA resources and to GTT when we allocate VRAM.

Drop all those workarounds and generalize this for GTT as well. This
fixes ENOMEM issues with runaway applications which try to allocate/free
GTT in a loop and are otherwise only limited by the CPU speed.

The CS will wait for the cleanup of freed up BOs to satisfy the
various domain specific limits and so effectively throttle those
buggy applications down to a sane allocation behavior again.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c