mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
drm/ttm: rework BO delayed delete. v2
This patch reworks the whole delayed deletion of BOs which aren't idle. Instead of having two counters for the BO structure we resurrect the BO when we find that a deleted BO is not idle yet. This has many advantages, especially that we don't need to increment/decrement the BOs reference counter any more when it moves on the LRUs. v2: remove duplicate ttm_tt_destroy, fix holde lock for LRU move Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: xinhui pan <xinhui.pan@amd.com> Link: https://patchwork.freedesktop.org/patch/352912/
This commit is contained in:
parent
b1df3a2b24
commit
1ec39923ef
3 changed files with 97 additions and 132 deletions
|
@ -135,18 +135,14 @@ struct ttm_tt;
|
|||
* @num_pages: Actual number of pages.
|
||||
* @acc_size: Accounted size for this object.
|
||||
* @kref: Reference count of this buffer object. When this refcount reaches
|
||||
* zero, the object is put on the delayed delete list.
|
||||
* @list_kref: List reference count of this buffer object. This member is
|
||||
* used to avoid destruction while the buffer object is still on a list.
|
||||
* Lru lists may keep one refcount, the delayed delete list, and kref != 0
|
||||
* keeps one refcount. When this refcount reaches zero,
|
||||
* the object is destroyed.
|
||||
* zero, the object is destroyed or put on the delayed delete list.
|
||||
* @mem: structure describing current placement.
|
||||
* @persistent_swap_storage: Usually the swap storage is deleted for buffers
|
||||
* pinned in physical memory. If this behaviour is not desired, this member
|
||||
* holds a pointer to a persistent shmem object.
|
||||
* @ttm: TTM structure holding system pages.
|
||||
* @evicted: Whether the object was evicted without user-space knowing.
|
||||
* @deleted: True if the object is only a zombie and already deleted.
|
||||
* @lru: List head for the lru list.
|
||||
* @ddestroy: List head for the delayed destroy list.
|
||||
* @swap: List head for swap LRU list.
|
||||
|
@ -183,9 +179,7 @@ struct ttm_buffer_object {
|
|||
/**
|
||||
* Members not needing protection.
|
||||
*/
|
||||
|
||||
struct kref kref;
|
||||
struct kref list_kref;
|
||||
|
||||
/**
|
||||
* Members protected by the bo::resv::reserved lock.
|
||||
|
@ -195,6 +189,7 @@ struct ttm_buffer_object {
|
|||
struct file *persistent_swap_storage;
|
||||
struct ttm_tt *ttm;
|
||||
bool evicted;
|
||||
bool deleted;
|
||||
|
||||
/**
|
||||
* Members protected by the bdev::lru_lock.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue