Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46f5b71b authored by Liam Mark's avatar Liam Mark
Browse files

ion: shrinker free pages even for unmovable page requests



In the secure CMA heap shrinker free pooled free CMA pages
even for unmovable page requests.

Most memory reclaim is performed by kswapd which uses a gfp
mask of GFP_KERNEL. Therefore even when the system is looking
for movable pages memory reclaim will generally be done by
kswapd.

By allowing the secure CMA heap shrinker to return free pooled
CMA pages for unmovable page requests there will generally be
a headroom improvement whenever a memory intensive userpace use
case is carried out after CMA memory is freed by its client.

Change-Id: Id6edcef4952aa86499220281470189ff93f8026a
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent b53e80fb
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -378,13 +378,6 @@ static int ion_secure_cma_shrinker(struct shrinker *shrinker,
	if (nr_to_scan == 0)
		return atomic_read(&sheap->total_pool_size);

	/*
	 * CMA pages can only be used for movable allocation so don't free if
	 * the allocation isn't movable
	 */
	if (!(sc->gfp_mask & __GFP_MOVABLE))
		return atomic_read(&sheap->total_pool_size);

	/*
	 * Allocation path may invoke the shrinker. Proceeding any further
	 * would cause a deadlock in several places so don't shrink if that