diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-12-01 11:21:34 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-12 20:46:25 +0100 |
commit | 0aaa59f5256eb2d23f487c3e2c870c7bc0d043de (patch) | |
tree | 3f2be4592849fdf45eb1242ccac2ad42bddceff4 /drivers/gpu/drm/ttm | |
parent | drm/amdgpu: allow get_vm_pde to change flags as well (diff) | |
download | linux-0aaa59f5256eb2d23f487c3e2c870c7bc0d043de.tar.xz linux-0aaa59f5256eb2d23f487c3e2c870c7bc0d043de.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 44343a2bf55c..71945ccaf012 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order; if (freed >= sc->nr_to_scan) break; + shrink_pages <<= pool->order; } mutex_unlock(&lock); return freed; |