drm/ttm: fix incorrect calculate on shrink_pages

shrink_pages is in unit of Order after ttm_page_pool_free,
but it is used by nr_free in next round so need change
it into native page unit

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Monk Liu 2017-12-01 18:21:34 +08:00 committed by Alex Deucher
parent 3de676d8e7
commit 0aaa59f525
1 changed files with 1 additions and 0 deletions

View File

@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
freed += (nr_free_pool - shrink_pages) << pool->order; freed += (nr_free_pool - shrink_pages) << pool->order;
if (freed >= sc->nr_to_scan) if (freed >= sc->nr_to_scan)
break; break;
shrink_pages <<= pool->order;
} }
mutex_unlock(&lock); mutex_unlock(&lock);
return freed; return freed;