/* Use kmalloc if possible for the page list. Otherwise fall back to vmalloc. This speeds things up and also saves memory for small AGP regions.  */
void agp_alloc_page_array(size_t size, struct agp_memory *mem)
/* Use kmalloc if possible for the page list. Otherwise fall back to vmalloc. This speeds things up and also saves memory for small AGP regions.  */
void agp_alloc_page_array(size_t size, struct agp_memory *mem)
{
	mem->pages = NULL;
	mem->vmalloc_flag = false;
	if (size <= 2*PAGE_SIZE)
		mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY);
	if (mem->pages == NULL) {
		mem->pages = vmalloc(size);
		mem->vmalloc_flag = true;
	}
}