Skip to content

Commit a9a238e

Browse files
Dave Chinnertorvalds
authored andcommitted
Revert "mm: slowly shrink slabs with a relatively small number of objects"
This reverts commit 172b06c ("mm: slowly shrink slabs with a relatively small number of objects"). This change changes the agressiveness of shrinker reclaim, causing small cache and low priority reclaim to greatly increase scanning pressure on small caches. As a result, light memory pressure has a disproportionate affect on small caches, and causes large caches to be reclaimed much faster than previously. As a result, it greatly perturbs the delicate balance of the VFS caches (dentry/inode vs file page cache) such that the inode/dentry caches are reclaimed much, much faster than the page cache and this drives us into several other caching imbalance related problems. As such, this is a bad change and needs to be reverted. [ Needs some massaging to retain the later seekless shrinker modifications.] Link: http://lkml.kernel.org/r/20190130041707.27750-3-david@fromorbit.com Fixes: 172b06c ("mm: slowly shrink slabs with a relatively small number of objects") Signed-off-by: Dave Chinner <dchinner@redhat.com> Cc: Wolfgang Walter <linux@stwm.de> Cc: Roman Gushchin <guro@fb.com> Cc: Spock <dairinin@gmail.com> Cc: Rik van Riel <riel@surriel.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 69056ee commit a9a238e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

mm/vmscan.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,6 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
491491
delta = freeable / 2;
492492
}
493493

494-
/*
495-
* Make sure we apply some minimal pressure on default priority
496-
* even on small cgroups. Stale objects are not only consuming memory
497-
* by themselves, but can also hold a reference to a dying cgroup,
498-
* preventing it from being reclaimed. A dying cgroup with all
499-
* corresponding structures like per-cpu stats and kmem caches
500-
* can be really big, so it may lead to a significant waste of memory.
501-
*/
502-
delta = max_t(unsigned long long, delta, min(freeable, batch_size));
503-
504494
total_scan += delta;
505495
if (total_scan < 0) {
506496
pr_err("shrink_slab: %pF negative objects to delete nr=%ld\n",

0 commit comments

Comments
 (0)