All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/amdgpu: Small cleanup for amdgpu_vm_update_funcs
@ 2026-12-03 21:41 Thadeu Lima de Souza Cascardo
  2026-12-03 21:41 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo
  2026-12-03 21:41 ` [PATCH 2/2] drm/amdgpu: pass job id as part of amdgpu_vm_update_params Thadeu Lima de Souza Cascardo
  0 siblings, 2 replies; 8+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2026-12-03 21:41 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Sumit Semwal, Zihao Mu
  Cc: amd-gfx, dri-devel, kernel-dev, Thadeu Lima de Souza Cascardo

These small fixups may help on some potential fixes later on. They
remove an unecessary error check and move one parameter to struct
amdgpu_vm_update_params.

The only functional change is a debug identification of the job origin,
which would now show up as the source of the request, not the
resubmission.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
Thadeu Lima de Souza Cascardo (2):
      drm/amdgpu: make amdgpu_vm_update_funcs commit return void
      drm/amdgpu: pass job id as part of amdgpu_vm_update_params

 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c          | 16 ++++++----------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c      | 12 ++++--------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h | 11 ++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c       |  6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c     | 23 ++++++++---------------
 5 files changed, 29 insertions(+), 39 deletions(-)
---
base-commit: 1593170fbfe185c107343775d7fae86b6354bd86
base-tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next
change-id: 20261203-amdgpu_vm_update_funcs_cleanup-025560f4f94a

Best regards,
--  
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 0/2] drm/amdgpu: fix memleak when amdgpu_vm_ptes_update fails
@ 2026-09-29 20:34 Thadeu Lima de Souza Cascardo
  2026-09-29 20:34 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 8+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2026-09-29 20:34 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Sumit Semwal, Felix Kuehling, Chunming Zhou, Tvrtko Ursulin,
	Natalie Vock
  Cc: amd-gfx, dri-devel, kernel-dev, Thadeu Lima de Souza Cascardo

When amdgpu_vm_ptes_update fails, there might be an IB jobs leak.

This was built on top of the patchset at [1].

A first attempt at fixing this was submitted at [2]. In that thread, it
was discussed that the failure happens due to an unmap trying to split a
hugepage and trying to allocate a PT BO. This is fixed by the patchset
at [1], by making the unmap not allocate any BOs.

However, the same failure might happen later, when the new mappings are
setup and the PT BO needs to be allocated.

The approach taken here is that instead of doing a commit, we introduce
a new abort operation and call it. In the case of SDMA, it frees the
job.

The commit still refers to amdgpu_vm_update_range, but the leak has been
reproduced with the patchset, so it shows up at amdgpu_vm_map_range. I
kept the original function name in the commit, however, as we might
consider to backport this.

[1] https://lore.kernel.org/amd-gfx/20260928151041.1857-1-christian.koenig@amd.com/
[2] https://lore.kernel.org/amd-gfx/20260914-amdgpu_vm_fixes-v1-0-d6d835591e0f@igalia.com/

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
Thadeu Lima de Souza Cascardo (2):
      drm/amdgpu: make amdgpu_vm_update_funcs commit return void
      drm/amdgpu: free job when amdgpu_vm_ptes_update fails

 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c          | 24 ++++++++++++------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c      | 13 ++++++++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_internal.h |  5 +++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c       |  9 ++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c     | 20 +++++++++++---------
 5 files changed, 40 insertions(+), 31 deletions(-)
---
base-commit: a7629c76ab981c0d5749eef9f4e47d12a2083330
change-id: 20260929-amdgpu_vm_update_funcs_abort-97cb4349b68d

Best regards,
--  
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-12-04 14:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 21:41 [PATCH 0/2] drm/amdgpu: Small cleanup for amdgpu_vm_update_funcs Thadeu Lima de Souza Cascardo
2026-12-03 21:41 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo
2026-12-04  9:52   ` Christian König
2026-12-04 14:41     ` Alex Deucher
2026-12-03 21:41 ` [PATCH 2/2] drm/amdgpu: pass job id as part of amdgpu_vm_update_params Thadeu Lima de Souza Cascardo
2026-12-03 22:01   ` sashiko-bot
2026-12-04  9:53   ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2026-09-29 20:34 [PATCH 0/2] drm/amdgpu: fix memleak when amdgpu_vm_ptes_update fails Thadeu Lima de Souza Cascardo
2026-09-29 20:34 ` [PATCH 1/2] drm/amdgpu: make amdgpu_vm_update_funcs commit return void Thadeu Lima de Souza Cascardo

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.