From: Konrad Rzeszutek Wilk Date: Wed, 4 Jan 2012 21:35:15 +0000 (-0500) Subject: drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't... X-Git-Tag: v3.3-rc1~121^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c05114d23c4fd2256eaf5645528c19fcefdb2c8;p=pandora-kernel.git drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages. The code to figure out how many pages to shrink the pool ends up capping the 'count' at _manager->options.max_size - which is OK. Except that the 'count' is also used when accounting for how many pages are recycled - which we end up with the invalid values. This fixes it by using a different value for the amount of pages to shrink. On top of that we would free the cached page pool - which is nonsense as they are deleted from the pool - so there are no free pages in that pool.. Also we also missed the opportunity to batch the amount of pages to free (similar to how ttm_page_alloc.c does it). This reintroduces the code that was lost during rebasing. Reviewed-by: Jerome Glisse Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Dave Airlie --- Reading git-diff-tree failed