]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
nvmap: page pools: replace background allocator with background zeroer
authorColin Cross <ccross@android.com>
Tue, 12 Aug 2014 00:33:09 +0000 (17:33 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Tue, 12 May 2015 20:28:28 +0000 (13:28 -0700)
commit9cee56cba6f5cfb28eb02ccdd4ba27d4ef793ce7
tree7d54994672ae111c1ac35f0a6d38d0b17213e890
parentc81dc1143c8c6d642adfd527ba43d16355ffd373
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>
drivers/video/tegra/nvmap/nvmap_handle.c
drivers/video/tegra/nvmap/nvmap_pp.c
drivers/video/tegra/nvmap/nvmap_priv.h