Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/amdgpu: infinite retry loop in
  amdgpu_userq_ensure_ev_fence() [1]
--

commit 1073e972cefe081a3547954bcb099da6f1184516
Author: Arisa Snowbell <[email protected]>

drm/amdgpu/userq: don't restore user queues during system sleep

This commit blocks user queue restore work from being scheduled during
system sleep preparation and moves the restore worker to
system_freezable_wq so restores do not race with VRAM eviction.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index ed6f3b67e8720..7960341f7f84f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

[ ... ]

> @@ -453,7 +464,7 @@ amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr 
> *uq_mgr,
>                * Looks like there was no pending resume work,
>                * add one now to create a valid eviction fence
>                */
> -             schedule_delayed_work(&uq_mgr->resume_work, 0);
> +             amdgpu_userq_queue_restore(uq_mgr);
>               goto retry;

[Severity: High]
This problem wasn't introduced by this patch, but can
amdgpu_userq_ensure_ev_fence() loop forever [1] if
amdgpu_userq_restore_worker() fails to install a new eviction fence?

When amdgpu_userq_vm_validate_and_restore_queue() fails (for example
with -ENOMEM), amdgpu_userq_restore_worker() exits without replacing
the signaled eviction fence:

drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c:amdgpu_userq_restore_worker() {
    ...
        ret = amdgpu_userq_vm_validate_and_restore_queue(uq_mgr);
        if (ret) {
                drm_file_err(uq_mgr->file, "Failed to validate BOs to restore 
ret=%d\n", ret);
                goto put_fence;
        }
    ...
}

amdgpu_userq_ensure_ev_fence() then sees the same signaled fence on the
next iteration and re-queues resume_work in an unkillable loop.

[1] https://sashiko.dev/#/bug/linux-d9fc724f-ccb0-417c-8973-b83fdfc48280

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to