mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	drm/ttm: Optimize ttm_eu_backoff_reservation
Avoid the ttm_bo_unreserve() spinlocks by calling ttm_eu_backoff_reservation_locked under the lru spinlock. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jerome Glisse <j.glisse@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
		
							parent
							
								
									2357cbe5f4
								
							
						
					
					
						commit
						68c4fa31aa
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -101,15 +101,16 @@ static int ttm_eu_wait_unreserved_locked(struct list_head *list,
 | 
				
			||||||
void ttm_eu_backoff_reservation(struct list_head *list)
 | 
					void ttm_eu_backoff_reservation(struct list_head *list)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct ttm_validate_buffer *entry;
 | 
						struct ttm_validate_buffer *entry;
 | 
				
			||||||
 | 
						struct ttm_bo_global *glob;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(entry, list, head) {
 | 
						if (list_empty(list))
 | 
				
			||||||
		struct ttm_buffer_object *bo = entry->bo;
 | 
							return;
 | 
				
			||||||
		if (!entry->reserved)
 | 
					 | 
				
			||||||
			continue;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		entry->reserved = false;
 | 
						entry = list_first_entry(list, struct ttm_validate_buffer, head);
 | 
				
			||||||
		ttm_bo_unreserve(bo);
 | 
						glob = entry->bo->glob;
 | 
				
			||||||
	}
 | 
						spin_lock(&glob->lru_lock);
 | 
				
			||||||
 | 
						ttm_eu_backoff_reservation_locked(list);
 | 
				
			||||||
 | 
						spin_unlock(&glob->lru_lock);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL(ttm_eu_backoff_reservation);
 | 
					EXPORT_SYMBOL(ttm_eu_backoff_reservation);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue