Skip to content
Snippets Groups Projects
  • Jie1zhang's avatar
    b09cdeb4
    drm/amdgpu: Optimize VM invalidation engine allocation and synchronize GPU TLB flush · b09cdeb4
    Jie1zhang authored
    
    - Modify the VM invalidation engine allocation logic to handle SDMA page rings.
      SDMA page rings now share the VM invalidation engine with SDMA gfx rings instead of
      allocating a separate engine. This change ensures efficient resource management and
      avoids the issue of insufficient VM invalidation engines.
    
    - Add synchronization for GPU TLB flush operations in gmc_v9_0.c.
      Use spin_lock and spin_unlock to ensure thread safety and prevent race conditions
      during TLB flush operations. This improves the stability and reliability of the driver,
      especially in multi-threaded environments.
    
     v2: replace the sdma ring check with a function `amdgpu_sdma_is_page_queue`
     to check if a ring is an SDMA page queue.(Lijo)
    
     v3: Add GC version check, only enabled on GC9.4.3/9.4.4/9.5.0
     v4: Fix code style and add more detailed description (Christian)
     v5: Remove dependency on vm_inv_eng loop order, explicitly lookup shared inv_eng(Christian/Lijo)
     v6: Added search shared ring function amdgpu_sdma_get_shared_ring (Lijo)
    
    Suggested-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Signed-off-by: default avatarJesse Zhang <jesse.zhang@amd.com>
    Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    b09cdeb4
    History
    drm/amdgpu: Optimize VM invalidation engine allocation and synchronize GPU TLB flush
    Jie1zhang authored
    
    - Modify the VM invalidation engine allocation logic to handle SDMA page rings.
      SDMA page rings now share the VM invalidation engine with SDMA gfx rings instead of
      allocating a separate engine. This change ensures efficient resource management and
      avoids the issue of insufficient VM invalidation engines.
    
    - Add synchronization for GPU TLB flush operations in gmc_v9_0.c.
      Use spin_lock and spin_unlock to ensure thread safety and prevent race conditions
      during TLB flush operations. This improves the stability and reliability of the driver,
      especially in multi-threaded environments.
    
     v2: replace the sdma ring check with a function `amdgpu_sdma_is_page_queue`
     to check if a ring is an SDMA page queue.(Lijo)
    
     v3: Add GC version check, only enabled on GC9.4.3/9.4.4/9.5.0
     v4: Fix code style and add more detailed description (Christian)
     v5: Remove dependency on vm_inv_eng loop order, explicitly lookup shared inv_eng(Christian/Lijo)
     v6: Added search shared ring function amdgpu_sdma_get_shared_ring (Lijo)
    
    Suggested-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Signed-off-by: default avatarJesse Zhang <jesse.zhang@amd.com>
    Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>