[PATCH] drm/ttm: Fix TTM BO accounting

2016-04-12 Thread Thomas Hellstrom
On 04/12/2016 06:39 PM, Felix Kuehling wrote: > This is the implementation of ttm_round_pot: > > size_t ttm_round_pot(size_t size) > { > if ((size & (size - 1)) == 0) > return size; > else if (size > PAGE_SIZE) > return PAGE_ALIGN(size); > els

[PATCH] drm/ttm: Fix TTM BO accounting

2016-04-12 Thread Thomas Hellstrom
On 04/12/2016 05:57 PM, Alex Deucher wrote: > From: Felix Kuehling > > TTM BO accounting is out of sync with how memory is really allocated > in ttm[_dma]_tt_alloc_page_directory. This resulted in excessive > estimated overhead with many small allocations. > > ttm_dma_tt_alloc_page_directory makes

[PATCH] drm/ttm: Fix TTM BO accounting

2016-04-12 Thread Felix Kuehling
This is the implementation of ttm_round_pot: size_t ttm_round_pot(size_t size) { if ((size & (size - 1)) == 0) return size; else if (size > PAGE_SIZE) return PAGE_ALIGN(size); else { size_t tmp_size = 4; while

[PATCH] drm/ttm: Fix TTM BO accounting

2016-04-12 Thread Alex Deucher
From: Felix Kuehling TTM BO accounting is out of sync with how memory is really allocated in ttm[_dma]_tt_alloc_page_directory. This resulted in excessive estimated overhead with many small allocations. ttm_dma_tt_alloc_page_directory makes a single allocation for three arrays: pages, DMA and CP