提交 36fd7c5c 编写于 作者: C Christian König 提交者: Alex Deucher

drm/amdgpu: prefer VMIDs idle on the current ring

Prefer to use a VMIDs which are idle on the ring we want to submit to. This
also removes bubbling idle VMIDs up on the LRU, which is actually not
beneficial.
Acked-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NChristian König <christian.koenig@amd.com>
Acked-by: NChunming Zhou <david1.zhou@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 35420238
...@@ -236,21 +236,15 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, ...@@ -236,21 +236,15 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
} while (i != ring->idx); } while (i != ring->idx);
id = list_first_entry(&adev->vm_manager.ids_lru, /* Check if we have an idle VMID */
struct amdgpu_vm_id, list_for_each_entry(id, &adev->vm_manager.ids_lru, list) {
list); if (amdgpu_sync_is_idle(&id->active, ring))
break;
if (!amdgpu_sync_is_idle(&id->active, NULL)) {
struct list_head *head = &adev->vm_manager.ids_lru; }
struct amdgpu_vm_id *tmp;
/* If we can't find a idle VMID to use, just wait for the oldest */
list_for_each_entry_safe(id, tmp, &adev->vm_manager.ids_lru, if (&id->list == &adev->vm_manager.ids_lru) {
list) {
if (amdgpu_sync_is_idle(&id->active, NULL)) {
list_move(&id->list, head);
head = &id->list;
}
}
id = list_first_entry(&adev->vm_manager.ids_lru, id = list_first_entry(&adev->vm_manager.ids_lru,
struct amdgpu_vm_id, struct amdgpu_vm_id,
list); list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册