From: "Christian König" <christian.koenig@amd.com>
To: "Liang, Prike" <Prike.Liang@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>
Subject: Re: [PATCH v3 2/5] drm/amdgpu: don't sync the user queue eviction fence
Date: Tue, 6 May 2025 10:23:02 +0200 [thread overview]
Message-ID: <6258d434-dca8-42e2-8e12-d14d0ef6abff@amd.com> (raw)
In-Reply-To: <DS7PR12MB6005F0A315798BE0F22E05EEFB892@DS7PR12MB6005.namprd12.prod.outlook.com>
On 5/6/25 04:09, Liang, Prike wrote:
> [Public]
>
>> From: Koenig, Christian <Christian.Koenig@amd.com>
>> Sent: Wednesday, April 30, 2025 7:57 PM
>> To: Liang, Prike <Prike.Liang@amd.com>; amd-gfx@lists.freedesktop.org
>> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
>> Subject: Re: [PATCH v3 2/5] drm/amdgpu: don't sync the user queue eviction
>> fence
>>
>> On 4/30/25 04:40, Prike Liang wrote:
>>> Don't return and sync the user queue eviction fence; otherwise, the
>>> eviction fence will be returned as a dependent fence during VM update
>>> and refer to the fence result in leakage.
>>
>> Please drop that patch, it shouldn't be needed any more after the changes in
>> patch #1.
>
> Yes, may I get patch#1( drm/amdgpu: promote the implicit sync to the dependent read fences) reviewed?
Sorry, I thought I've already done that.
Feel free to add Reviewed-by: Christian König <christian.koenig@amd.com> to that patch.
Regards,
Christian.
>
>
>> Regards,
>> Christian.
>>
>>>
>>> Signed-off-by: Prike Liang <Prike.Liang@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 11 +++++++++++
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h | 1 +
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 ++++
>>> 3 files changed, 16 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
>>> index d86e611a9ff4..6c9b2b43a929 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
>>> @@ -224,6 +224,17 @@ void amdgpu_eviction_fence_detach(struct
>> amdgpu_eviction_fence_mgr *evf_mgr,
>>> dma_fence_put(stub);
>>> }
>>>
>>> +bool amdgpu_eviction_fence_valid(struct dma_fence *f) {
>>> +
>>> + if(!f)
>>> + return false;
>>> + if (f->ops == &amdgpu_eviction_fence_ops)
>>> + return true;
>>> +
>>> + return false;
>>> +}
>>> +
>>> int amdgpu_eviction_fence_init(struct amdgpu_eviction_fence_mgr
>>> *evf_mgr) {
>>> /* This needs to be done one time per open */ diff --git
>>> a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h
>>> index fcd867b7147d..d4e1975cac71 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h
>>> @@ -42,6 +42,7 @@ struct amdgpu_eviction_fence_mgr { };
>>>
>>> /* Eviction fence helper functions */
>>> +bool amdgpu_eviction_fence_valid(struct dma_fence *f);
>>> struct amdgpu_eviction_fence *
>>> amdgpu_eviction_fence_create(struct amdgpu_eviction_fence_mgr
>>> *evf_mgr);
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
>>> index d6ae9974c952..8ac685eb1be1 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
>>> @@ -185,6 +185,10 @@ static bool amdgpu_sync_test_fence(struct
>>> amdgpu_device *adev, {
>>> void *fence_owner = amdgpu_sync_get_owner(f);
>>>
>>> + /* don't sync the kgd userq eviction fence*/
>>> + if(amdgpu_eviction_fence_valid(f))
>>> + return false;
>>> +
>>> /* Always sync to moves, no matter what */
>>> if (fence_owner == AMDGPU_FENCE_OWNER_UNDEFINED)
>>> return true;
>
next prev parent reply other threads:[~2025-05-06 8:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 2:40 [PATCH v3 1/5] drm/amdgpu: promote the implicit sync to the dependent read fences Prike Liang
2025-04-30 2:40 ` [PATCH v3 2/5] drm/amdgpu: don't sync the user queue eviction fence Prike Liang
2025-04-30 11:56 ` Christian König
2025-05-06 2:09 ` Liang, Prike
2025-05-06 8:23 ` Christian König [this message]
2025-05-06 8:59 ` Liang, Prike
2025-04-30 2:40 ` [PATCH v3 3/5] drm/amdgpu: fix the eviction fence dereference Prike Liang
2025-04-30 11:58 ` Christian König
2025-05-06 2:19 ` Liang, Prike
2025-04-30 2:40 ` [PATCH v3 4/5] drm/amdgpu: validate the eviction fence before attaching/detaching Prike Liang
2025-04-30 12:01 ` Christian König
2025-05-06 8:22 ` Liang, Prike
2025-05-06 8:38 ` Christian König
2025-05-08 7:08 ` Liang, Prike
2025-05-08 9:40 ` Christian König
2025-04-30 2:40 ` [PATCH v3 5/5] drm/amdgpu: lock the eviction fence before signaling it Prike Liang
2025-04-30 12:03 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6258d434-dca8-42e2-8e12-d14d0ef6abff@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Prike.Liang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox