drm/ttm: Merge hugepage attr changes in ttm_dma_page_put. (v2)
Every set_pages_array_wb call resulted in cross-core interrupts and TLB flushes. Merge more of them for less overhead. This reduces the time needed to free a 1.6 GiB GTT WC buffer as part of Vulkan CTS from ~2 sec to < 0.25 sec. (Allocation still takes more than 2 sec though) (v2): use set_pages_wb instead of set_memory_wb. Signed-off-by: Bas Nieuwenhuizen <basni@chromium.org> Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Родитель
d55f9b8742
Коммит
610b399f1f
|
@ -349,17 +349,14 @@ static void ttm_pool_update_free_locked(struct dma_pool *pool,
|
||||||
static void ttm_dma_page_put(struct dma_pool *pool, struct dma_page *d_page)
|
static void ttm_dma_page_put(struct dma_pool *pool, struct dma_page *d_page)
|
||||||
{
|
{
|
||||||
struct page *page = d_page->p;
|
struct page *page = d_page->p;
|
||||||
unsigned i, num_pages;
|
unsigned num_pages;
|
||||||
|
|
||||||
/* Don't set WB on WB page pool. */
|
/* Don't set WB on WB page pool. */
|
||||||
if (!(pool->type & IS_CACHED)) {
|
if (!(pool->type & IS_CACHED)) {
|
||||||
num_pages = pool->size / PAGE_SIZE;
|
num_pages = pool->size / PAGE_SIZE;
|
||||||
for (i = 0; i < num_pages; ++i, ++page) {
|
if (ttm_set_pages_wb(page, num_pages))
|
||||||
if (ttm_set_pages_array_wb(&page, 1)) {
|
pr_err("%s: Failed to set %d pages to wb!\n",
|
||||||
pr_err("%s: Failed to set %d pages to wb!\n",
|
pool->dev_name, num_pages);
|
||||||
pool->dev_name, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
list_del(&d_page->page_list);
|
list_del(&d_page->page_list);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче