Author: dumbbell Date: Sun Aug 25 15:05:22 2013 New Revision: 254873 URL: http://svnweb.freebsd.org/changeset/base/254873
Log: drm/ttm: When removing a range of pages from a pool, remove all of them Submitted by: Mark Kettenis and Jonathan Gray from OpenBSD Approved by: kib@ Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Sun Aug 25 15:01:43 2013 (r254872) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Sun Aug 25 15:05:22 2013 (r254873) @@ -320,6 +320,7 @@ static int ttm_page_pool_free(struct ttm vm_page_t *pages_to_free; unsigned freed_pages = 0, npages_to_free = nr_free; + unsigned i; if (NUM_PAGES_TO_ALLOC < nr_free) npages_to_free = NUM_PAGES_TO_ALLOC; @@ -338,7 +339,8 @@ restart: /* We can only remove NUM_PAGES_TO_ALLOC at a time. */ if (freed_pages >= NUM_PAGES_TO_ALLOC) { /* remove range of pages from the pool */ - TAILQ_REMOVE(&pool->list, p, plinks.q); + for (i = 0; i < freed_pages; i++) + TAILQ_REMOVE(&pool->list, pages_to_free[i], plinks.q); ttm_pool_update_free_locked(pool, freed_pages); /** @@ -373,7 +375,8 @@ restart: /* remove range of pages from the pool */ if (freed_pages) { - TAILQ_REMOVE(&pool->list, p, plinks.q); + for (i = 0; i < freed_pages; i++) + TAILQ_REMOVE(&pool->list, pages_to_free[i], plinks.q); ttm_pool_update_free_locked(pool, freed_pages); nr_free -= freed_pages; _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"