AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] drm/amdgpu: fixes for the VM critical section and page fault rework
@ 2026-09-17 11:01 Huang Yu
  2026-09-17 11:01 ` [PATCH 01/13] drm/amdgpu: start to move VM internals into amdgpu_vm_internal.h Huang Yu
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Huang Yu @ 2026-09-17 11:01 UTC (permalink / raw)
  To: Christian König
  Cc: Yu Huang, Honglei Huang, Ray Huang, Shen Junhua, Lingshan Zhu,
	Timur Cristof, Natalie Vock, AMD-GFX

Hi Christian,

patches 1-8 and 10 are your VM rework. The other four are fixes found
while testing it with KFD SVM on top:

1. patch 09: amdgpu_vm_pt_alloc() leaks the new PT BO when the
   allocation succeeds but the VM is evicting once the critical section
   is re-entered. Release the unpublished BO, keep the critical section
   owned by the caller.

2. patch 11: amdgpu_vm_pt_leaves() always updated cursor.parent->bo, so
   a walk stopping at an allocated PTB wrote a PDE in the parent instead
   of the PTEs in the leaf. Use the entry's own BO and level, and go
   through amdgpu_vm_pte_update_flags().

3. patch 12: both callers passed an inclusive last address, but
   amdgpu_vm_pt_leaves() works on a half-open range. That dropped the
   last page in amdgpu_vm_unmap_range(), and made amdgpu_vm_handle_fault()
   skip the loop entirely, so AMDGPU_VM_NORETRY_FLAGS were never written
   and the wave kept retrying.

4. patch 13: for a redirect to the dummy hierarchy above the PTE level
   the entry points to the next-level dummy PD/PT, but
   amdgpu_vm_pte_update_flags() treats everything above PTB as a leaf and
   applies AMDGPU_PDE_PTE_FLAG(). Encode it with
   amdgpu_gmc_get_pde_for_bo() instead.

One question on patch 13: it special cases the dummy PDE inside
amdgpu_vm_pt_leaves(), which adds a second update path next to
amdgpu_vm_pte_update_flags(). The alternatives are to let
amdgpu_vm_pte_update_flags() encode a directory entry when the level is
not AMDGPU_VM_PTB, or to pass already encoded dummy PDEs in dst[] from
amdgpu_vm_handle_fault(). Which one do you prefer?

Thanks,
Yu

Christian König (9):
  drm/amdgpu: start to move VM internals into amdgpu_vm_internal.h
  drm/amdgpu: remove unecessary parameters from
    trace_amdgpu_vm_update_ptes
  drm/amdgpu: allocate and fill dummy PDs/PTs
  drm/amdgpu: add amdgpu_vm_pt_leaves()
  drm/amdgpu: drop immediate updates from amdgpu_vm_update_range
  drm/amdgpu: split amdgpu_vm_update_range
  drm/amdgpu: nuke most amdgpu_vm_eviction_(try)lock uses
  drm/amdgpu: rework eviction lock handling into critical section v2
  drm/amdgpu: fix the HMM range handling for KFD SVM

Yu Huang (4):
  drm/amdgpu: free PT when VM critical section cannot resume
  drm/amdgpu: update the PTB itself in amdgpu_vm_pt_leaves()
  drm/amdgpu: pass an exclusive end to amdgpu_vm_pt_leaves()
  drm/amdgpu: use directory flags for dummy PDEs

-- 
2.53.0


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

end of thread, other threads:[~2026-09-21 11:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 11:01 [PATCH 00/13] drm/amdgpu: fixes for the VM critical section and page fault rework Huang Yu
2026-09-17 11:01 ` [PATCH 01/13] drm/amdgpu: start to move VM internals into amdgpu_vm_internal.h Huang Yu
2026-09-21 11:36   ` Timur Kristóf
2026-09-17 11:01 ` [PATCH 02/13] drm/amdgpu: remove unecessary parameters from trace_amdgpu_vm_update_ptes Huang Yu
2026-09-21 11:37   ` Timur Kristóf
2026-09-17 11:01 ` [PATCH 03/13] drm/amdgpu: allocate and fill dummy PDs/PTs Huang Yu
2026-09-21 11:37   ` Timur Kristóf
2026-09-17 11:01 ` [PATCH 04/13] drm/amdgpu: add amdgpu_vm_pt_leaves() Huang Yu
2026-09-21 11:39   ` Timur Kristóf
2026-09-17 11:01 ` [PATCH 05/13] drm/amdgpu: drop immediate updates from amdgpu_vm_update_range Huang Yu
2026-09-17 11:01 ` [PATCH 06/13] drm/amdgpu: split amdgpu_vm_update_range Huang Yu
2026-09-17 11:01 ` [PATCH 07/13] drm/amdgpu: nuke most amdgpu_vm_eviction_(try)lock uses Huang Yu
2026-09-17 11:01 ` [PATCH 08/13] drm/amdgpu: rework eviction lock handling into critical section v2 Huang Yu
2026-09-17 11:01 ` [PATCH 09/13] drm/amdgpu: free PT when VM critical section cannot resume Huang Yu
2026-09-17 11:01 ` [PATCH 10/13] drm/amdgpu: fix the HMM range handling for KFD SVM Huang Yu
2026-09-17 11:01 ` [PATCH 11/13] drm/amdgpu: update the PTB itself in amdgpu_vm_pt_leaves() Huang Yu
2026-09-17 11:01 ` [PATCH 12/13] drm/amdgpu: pass an exclusive end to amdgpu_vm_pt_leaves() Huang Yu
2026-09-17 11:01 ` [PATCH 13/13] drm/amdgpu: use directory flags for dummy PDEs Huang Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox