ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction
authoravg <avg@FreeBSD.org>
Mon, 15 Jun 2015 13:43:23 +0000 (13:43 +0000)
committeravg <avg@FreeBSD.org>
Mon, 15 Jun 2015 13:43:23 +0000 (13:43 +0000)
commit1aac2948e9f56ddb45abd36052cead08320c2f80
tree32a0089ae588b03a3694779c1a94733824c91ea0
parent2a3ec90af9d2a29ddfcfb0f66265da87045c2530
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction

This change re-organizes code a little bit to extract common pieces
of ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions.
Also, for requests without address restrictions regular vm_page_alloc()
is used.
Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before calling
vm_pageout_grow_cache() to ensure that there is enough free pages at all.

Reviewed by: kib
MFC after: 15 days
sys/dev/drm2/ttm/ttm_page_alloc.c