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

Commit f4f2620f authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: vmscan: support complete shrinker reclaim" into msm-4.9

parents 81168468 a708a02a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -319,6 +319,10 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
	long batch_size = shrinker->batch ? shrinker->batch
					  : SHRINK_BATCH;
	long scanned = 0, next_deferred;
	long min_cache_size = batch_size;

	if (current_is_kswapd())
		min_cache_size = 0;

	freeable = shrinker->count_objects(shrinker, shrinkctl);
	if (freeable == 0)
@@ -386,7 +390,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
	 * scanning at high prio and therefore should try to reclaim as much as
	 * possible.
	 */
	while (total_scan >= batch_size ||
	while (total_scan > min_cache_size ||
	       total_scan >= freeable) {
		unsigned long ret;
		unsigned long nr_to_scan = min(batch_size, total_scan);