From: "Christian König" <christian.koenig@amd.com>
To: Priya Hosur <Priya.Hosur@amd.com>,
amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com,
Sunil.Khatri@amd.com, Felix.Kuehling@amd.com,
Shaoyun.Liu@amd.com, Lijo.Lazar@amd.com,
Mario.Limonciello@amd.com
Cc: Pratik.Vishwakarma@amd.com, Veerabadhran.Gopalakrishnan@amd.com
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Add TLB flush after MES user queue unmap
Date: Mon, 24 Aug 2026 09:39:22 +0200 [thread overview]
Message-ID: <39ce25a7-c20b-4513-9ac1-3b636e3af6a5@amd.com> (raw)
In-Reply-To: <20260814161841.5906-3-Priya.Hosur@amd.com>
On 8/14/26 18:18, Priya Hosur wrote:
> Similar to the KFD fix, MES does not perform heavy-weight TLB
> invalidation after unmapping user queues. Add
> amdgpu_gmc_flush_gpu_tlb_pasid() after MES unmap succeeds in
> amdgpu_userq_unmap_helper() to ensure in-flight memory accesses
> complete before memory is freed or migrated.
>
> Change-Id: I94fe2c84547723b6b73816ce8d727a54bd773a6a
> Signed-off-by: Priya Hosur <Priya.Hosur@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index 6d3ed55e9ab4..9fcf15d69b7b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -375,6 +375,12 @@ static int amdgpu_userq_unmap_helper(struct amdgpu_usermode_queue *queue)
> } else {
> trace_amdgpu_userq_state_changed(queue, AMDGPU_USERQ_STATE_UNMAPPED);
> queue->state = AMDGPU_USERQ_STATE_UNMAPPED;
> + /*
> + * Heavy-weight TLB flush after MES unmaps queue to ensure
> + * in-flight memory accesses complete before memory is freed/migrated.
> + * MES does not do this automatically unlike HWS.
> + */
> + amdgpu_gmc_flush_gpu_tlb_pasid(adev, queue->vm->pasid, 2, true, 0);
Absolutely clear NAK to this.
The MES *must* guarantee that in flight memory accesses are completed before it unmaps the queue or otherwise we run into massive problems.
Flushing out any VM changes by invalidating the TLB doesn't change anything on that.
Regards,
Christian.
> }
> }
>
next prev parent reply other threads:[~2026-08-24 7:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 16:18 [PATCH v3 0/2] drm/amdkfd: Add TLB flush after MES queue eviction/suspension Priya Hosur
2026-08-14 16:18 ` [PATCH v3 1/2] " Priya Hosur
2026-08-14 16:18 ` [PATCH v3 2/2] drm/amdgpu: Add TLB flush after MES user queue unmap Priya Hosur
2026-08-14 16:29 ` Lazar, Lijo
2026-08-14 16:47 ` Kuehling, Felix
2026-08-14 17:25 ` Lazar, Lijo
2026-08-16 17:07 ` Hosur, Priya
2026-08-17 14:19 ` Alex Deucher
2026-08-17 14:25 ` Khatri, Sunil
2026-08-24 7:39 ` Christian König [this message]
2026-08-25 6:47 ` Khatri, Sunil
2026-08-25 10:36 ` Hosur, Priya
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=39ce25a7-c20b-4513-9ac1-3b636e3af6a5@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=Lijo.Lazar@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Pratik.Vishwakarma@amd.com \
--cc=Priya.Hosur@amd.com \
--cc=Shaoyun.Liu@amd.com \
--cc=Sunil.Khatri@amd.com \
--cc=Veerabadhran.Gopalakrishnan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.