[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02a0608a-d0cc-4cc7-9a99-a29dc006fd72@amd.com>
Date: Tue, 8 Jul 2025 10:41:48 +0200
From: Christian König <christian.koenig@....com>
To: Samuel Zhang <guoqing.zhang@....com>, alexander.deucher@....com,
rafael@...nel.org, len.brown@...el.com, pavel@...nel.org,
gregkh@...uxfoundation.org, dakr@...nel.org, airlied@...il.com,
simona@...ll.ch, ray.huang@....com, matthew.auld@...el.com,
matthew.brost@...el.com, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de
Cc: mario.limonciello@....com, lijo.lazar@....com, victor.zhao@....com,
haijun.chang@....com, Qing.Ma@....com, Owen.Zhang2@....com,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v3 2/5] drm/amdgpu: move GTT to shmem after eviction for
hibernation
On 08.07.25 09:42, Samuel Zhang wrote:
> When hibernate with data center dGPUs, huge number of VRAM BOs evicted
> to GTT and takes too much system memory. This will cause hibernation
> fail due to insufficient memory for creating the hibernation image.
>
> Move GTT BOs to shmem in KMD, then shmem to swap disk in kernel
> hibernation code to make room for hibernation image.
>
> Signed-off-by: Samuel Zhang <guoqing.zhang@....com>
Reviewed-by: Christian König <christian.koenig@....com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 684d66bc0b5f..2f977fece08f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -5021,8 +5021,16 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
> return 0;
>
> ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
> - if (ret)
> + if (ret) {
> dev_warn(adev->dev, "evicting device resources failed\n");
> + return ret;
> + }
> +
> + if (adev->in_s4) {
> + ret = ttm_device_prepare_hibernation(&adev->mman.bdev);
> + if (ret)
> + dev_err(adev->dev, "prepare hibernation failed, %d\n", ret);
> + }
> return ret;
> }
>
Powered by blists - more mailing lists