nvmap: page pools: replace background allocator with background zeroer
The background allocator rapidly becomes useless once the system
has filled memory with cached pages. It refuses to allocate when
free memory < 128MB (which it always is, the kernel is aiming to
keep very little free), and freed pages are not returned to the
page pool when zero_memory=1.
Remove the background allocator completely, and instead return
freed memory to the page pool in a separate list to be zeroed
in the background. This results in a self-balancing pool of
memory available to graphics, and reduces presure on the kernel's
page allocator. If the pool grows too big it will get reduced
by the shrinker. If it gets too small, the next allocation will
fall back to the page allocator, and then later return those pages
to the pool.
Before this change incremental page pool hit rate reported by
/d/nvmap/pagepool/page_pool_hits vs. /d/nvmap/pagepool/page_pool_misses
goes to 0% after boot. After this change it is near 100% for small
app launches and 75% for larger app launches.
Change-Id: I4bc914498d7d0369eef9e621bda110d9b8be90b2 Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/664674
GVS: Gerrit_Virtual_Submit
Reviewed-on: http://git-master/r/736428 Reviewed-by: Alex Waterman <alexw@nvidia.com> Tested-by: Alex Waterman <alexw@nvidia.com>