Re: [PATCH v4 0/1] drm/amdkfd: Add TLB flush after MES queue eviction/suspension

Christian König <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <[email protected]>
On 8/17/26 16:17, Alex Deucher wrote:
> On Mon, Aug 17, 2026 at 4:07 AM Lazar, Lijo <[email protected]> wrote:
>>
>>
>>
>> On 16-Aug-26 10:56 PM, Priya Hosur wrote:
>>> This patch adds heavy-weight TLB flush after MES queue eviction/suspension
>>> to fix SVM page migration hangs on gfx1151 with XNACK mode enabled.
>>>
>>> v4:
>>>    - Dropped userq TLB flush patch per Felix/Lijo feedback: TLB flush is only
>>>      needed after batch unmap in amdgpu_userq_unmap_all(), not per-queue unmap
>>>
>>
>> Sorry, that was not the intention. I was thinking there is a unmap_all
>> API in MES in which case this could be done within FW itself instead.
>>
> 
> There is a suspend_all and I believe the reset detect and
> detect_and_reset calls end up suspending all queues the type specified
> (gfx, compute, sdma).
> 
>> I believe Alex was also asking to check about batch unmap cases of user
>> queue. Ex: - amdgpu_eviction_fence_suspend_worker there could still be
>> inflight transactions similar to KFD case.
> 
> RIght.  When we evict a KGD userq process, we evict all of the queues
> for that GPU VM.

Yeah I completely agree with Lijo.

An unmap operation means that the MES *must* make sure that all work from the unmapped queue is finished. Usually by issuing something similar to an EOP packet/event.

A TLB invalidation is necessary when the debugger wants to attach and we only suspended the queue, e.g. in other words prevent work from continuing but doesn't take it of the HW or wait for it to finish.

So something here is clearly badly going wrong.

Regards,
Christian.

> 
> Alex
> 
>>
>> Thanks,
>> Lijo
>>
>>> v3:
>>>    - Split into 2 patches per Alex's review
>>>    - Added userq TLB flush in amdgpu_userq_unmap_helper() (amdgpu_userq.c)
>>>
>>> v2:
>>>    - Removed "SDMA" from comment as this affects all in-flight memory
>>>      accesses, not just SDMA (Felix Kuehling)
>>>    - Added Reviewed-by tag
>>>
>>> Priya Hosur (1):
>>>    drm/amdkfd: Add TLB flush after MES queue eviction/suspension
>>>
>>>   .../drm/amd/amdkfd/kfd_device_queue_manager.c | 10 ++++++++++
>>>   1 file changed, 10 insertions(+)
>>>
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.