linux/drivers/gpu/drm/ttm
Pauli Nieminen 1403b1a38e drm/ttm: add pool wc/uc page allocator V3
On AGP system we might allocate/free routinely uncached or wc memory,
changing page from cached (wb) to uc or wc is very expensive and involves
a lot of flushing. To improve performance this allocator use a pool
of uc,wc pages.

Pools are protected with spinlocks to allow multiple threads to allocate pages
simultanously. Expensive operations are done outside of spinlock to maximize
concurrency.

Pools are linked lists of pages that were recently freed. mm shrink callback
allows kernel to claim back pages when they are required for something else.

Fixes:
* set_pages_array_wb handles highmem pages so we don't have to remove them
  from pool.
* Add count parameter to ttm_put_pages to avoid looping in free code.
* Change looping from _safe to normal in pool fill error path.
* Initialize sum variable and make the loop prettier in get_num_unused_pages.

* Moved pages_freed reseting inside the loop in ttm_page_pool_free.
* Add warning comment about spinlock context in ttm_page_pool_free.

Based on Jerome Glisse's and Dave Airlie's pool allocator.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-06 11:35:26 +10:00
..
Makefile drm/ttm: add pool wc/uc page allocator V3 2010-04-06 11:35:26 +10:00
ttm_agp_backend.c agp: switch AGP to use page array instead of unsigned long array 2009-06-19 10:21:42 +10:00
ttm_bo.c Merge branch 'v2.6.34-rc2' into drm-linus 2010-03-31 14:55:14 +10:00
ttm_bo_util.c Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-02-01 10:46:49 -08:00
ttm_bo_vm.c drm/ttm: fix incorrect logic in ttm_bo_io path 2009-12-16 15:32:31 +10:00
ttm_execbuf_util.c drm/ttm: Add TTM execbuf utilities. 2009-12-07 15:22:05 +10:00
ttm_global.c drm/ttm: fix refcounting in ttm global code. 2009-10-06 15:46:10 +10:00
ttm_lock.c drm/ttm: Export symbols needed for vmwgfx suspend / resume operations. 2010-01-14 12:19:50 +10:00
ttm_memory.c drm/ttm: add pool wc/uc page allocator V3 2010-04-06 11:35:26 +10:00
ttm_module.c drm/ttm: Add a virtual ttm sysfs device. 2009-08-19 16:09:04 +10:00
ttm_object.c drm/ttm: remove padding from ttm_ref_object on 64bit builds 2010-02-01 11:24:50 +10:00
ttm_page_alloc.c drm/ttm: add pool wc/uc page allocator V3 2010-04-06 11:35:26 +10:00
ttm_tt.c drm/ttm: add pool wc/uc page allocator V3 2010-04-06 11:35:26 +10:00