I had the same question. But probably gradually decrementing uses too much+ memset(vmap_pages, 0,This is the case where a large enough contiguous physical memory chunk
+ sizeof(*vmap_pages) * vmap_page_index);
+ vmap_page_index = 0;
+
+ for (j = 0; j < i; j++)
+ __free_pages(pages[j], alloc_unit);
+
+ kfree(pages);
+ alloc_unit = 1;
could not be found. But rather than dropping all the way down to single
pages, would it make sense to try something smaller, but not 1? For
example, cut the alloc_unit in half and try again. But I'm not sure of
all the implications.
time?