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

Commit c8aa78d3 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: slowly shrink slabs with a relatively small number of objects"

parents 0f808648 5c619196
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -349,6 +349,17 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
	delta = freeable >> priority;
	delta *= 4;
	do_div(delta, shrinker->seeks);

	/*
	 * Make sure we apply some minimal pressure on default priority
	 * even on small cgroups. Stale objects are not only consuming memory
	 * by themselves, but can also hold a reference to a dying cgroup,
	 * preventing it from being reclaimed. A dying cgroup with all
	 * corresponding structures like per-cpu stats and kmem caches
	 * can be really big, so it may lead to a significant waste of memory.
	 */
	delta = max_t(unsigned long long, delta, min(freeable, batch_size));

	total_scan += delta;
	if (total_scan < 0) {
		pr_err("shrink_slab: %pF negative objects to delete nr=%ld\n",