Skip to content

Draft: drm: Introduce drm_alloc_lock - A simplified ww_rwsem for exhaustive eviction

Thomas Hellström requested to merge thomash/kernel:drm_alloc_lock into drm-xe-next

This functionality is needed for exhaustive eviction - A WIP functionality needed in TTM to be able for a single VM to be able to grab all of VRAM (minus pinned) in the precesence of competing small VMs that steals newly evicted memory from the evictor.

The functionality is that when there is no resource contention, memory allocations can be made in parallel. When a process needs to evict, it first locks out all other processes from allocating, and directs them to a ww_mutex, allowing only one process at a time to allocate and thus also to evict. The ww mutex in combination with sleeping ww locking at evict time will guarantee that the process eventually gets hold of all memory.

Note this is WIP. A drm_alloc_lock - aware LRU traversal and TTM eviction still needs implementing.

Merge request reports

Loading