[RFC] drm/ttm: add minimum residency constraint for bo eviction

Thomas Hellstrom thomas at shipmail.org
Thu Nov 29 01:48:19 PST 2012


On 11/29/2012 10:28 AM, Michel Dänzer wrote:
> On Don, 2012-11-29 at 10:18 +0100, Thomas Hellstrom wrote:
>> On 11/28/2012 10:51 PM, Marek Olšák wrote:
>>> I think the problem with Radeon/TTM is much deeper. Let me demonstrate
>>> it on the following example.
>>>
>>> Unigine Heaven needs about 385MB of space for static resources, that's
>>> only 75% of my 512MB card. Yet, TTM is not capable of getting all of
>>> that into VRAM. If I allow GTT placements, I get 20 fps, which is the
>>> old Mesa behavior. If I force VRAM placements, I get 3 fps, because we
>>> validate buffers 10 times per frame and there's probably a lot of
>>> buffer evictions during each validation.
>>>
>> Marek,
>> Did you look at the total amount of referenced buffers in the ring
>> including vertex buffers?
>>
>> Depending on how hard you throttle, I guess vertex / index buffer data
>> referenced by the
>> ring commands may well exceed the VRAM limitation.
> I think another reason 100% is not possible is fragmentation. Has anyone
> ever thought about defragmentation?
>
>
TTM doesn't support efficient defragmentation (yet :)) The only 
reasonable situation to defragment is when we've hit an OOM during 
buffer validation.

The execbuf code could then back off completely, shut other concurrent 
buffer validators out and call ttm_bo_evict_mm() to evict all buffers in the
failing memory type(s), and then retry validation.

This is of course very costly, so I guess it should only be used to 
avoid OOMS.

/Thomas





More information about the dri-devel mailing list