[PATCH 05/13] drm/ttm: overhaul memory accounting

Thomas Hellstrom thellstrom at vmware.com
Fri Nov 11 01:08:00 PST 2011


On 11/11/2011 09:47 AM, Dave Airlie wrote:
>> What are the symptoms of the failure you're seeing with Radeon? Any
>> suggestions on why it happens?
>>      
> I suspect radeon swapping might have some issues, I really think we
> should put the effort into a test suite like the intel-gpu-tools,
> instead of moving code around with no idea what is better or worse.
> (Jerome you can take this as a strong hint to work on some tests :-)
>
> Dave.
>    

I think many tests like this can be written using OpenGL (using some 
assumptions about where drivers store things like texture images etc. 
That could be useful for all drivers).

But for the specific radeon bo case, I had a quick look at the code:

1) Gem stuff is not accounted anywhere AFAICT. Gem idr memory? flink memory?
2) Radeon fences doesn't seem to be accounted anywhere.
3) Radeon bo accounting is completely incorrect. The accounting size 
given to ttm_bo_init() should be the size of the kmalloc'ed object, 
including size of page arrays and dma_addr arrays and gem stuff, but not 
the pages themselves. kmalloced memory sizes should also be rounded up 
to the nearest power of two to account for allocator granularity.

Before this is fixed, we shouldn't IMHO really blame TTM and try to 
rewrite it.

/Thomas



> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>    



More information about the dri-devel mailing list