mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
zram: allow zram to allocate CMA pages
Though zram pages are movable, they aren't allowed to enter MIGRATE_CMA pageblocks. zram is not seen to pin pages for long which can cause an issue. Moreover allowing zram to pick CMA pages can be helpful in cases seen where zram order 0 alloc fails when there are lots of free cma pages, resulting in kswapd or direct reclaim not making enough progress. Change-Id: Id27d1a31b6cd869ebb025b49b76d2b62ba666ccf Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
aefaddd897
commit
a96ae75ea9
2 changed files with 5 additions and 4 deletions
|
|
@ -1360,13 +1360,14 @@ compress_again:
|
|||
__GFP_KSWAPD_RECLAIM |
|
||||
__GFP_NOWARN |
|
||||
__GFP_HIGHMEM |
|
||||
__GFP_MOVABLE);
|
||||
__GFP_MOVABLE |
|
||||
__GFP_CMA);
|
||||
if (!handle) {
|
||||
zcomp_stream_put(zram->comp);
|
||||
atomic64_inc(&zram->stats.writestall);
|
||||
handle = zs_malloc(zram->mem_pool, comp_len,
|
||||
GFP_NOIO | __GFP_HIGHMEM |
|
||||
__GFP_MOVABLE);
|
||||
__GFP_MOVABLE | __GFP_CMA);
|
||||
if (handle)
|
||||
goto compress_again;
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static void destroy_cache(struct zs_pool *pool)
|
|||
static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp)
|
||||
{
|
||||
return (unsigned long)kmem_cache_alloc(pool->handle_cachep,
|
||||
gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
|
||||
gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE|__GFP_CMA));
|
||||
}
|
||||
|
||||
static void cache_free_handle(struct zs_pool *pool, unsigned long handle)
|
||||
|
|
@ -362,7 +362,7 @@ static void cache_free_handle(struct zs_pool *pool, unsigned long handle)
|
|||
static struct zspage *cache_alloc_zspage(struct zs_pool *pool, gfp_t flags)
|
||||
{
|
||||
return kmem_cache_alloc(pool->zspage_cachep,
|
||||
flags & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
|
||||
flags & ~(__GFP_HIGHMEM|__GFP_MOVABLE|__GFP_CMA));
|
||||
}
|
||||
|
||||
static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage)
|
||||
|
|
|
|||
Loading…
Reference in a new issue