Commit 24c32d733dd44dbc5b9dcd0b8de58e16fdbeac76

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent d52b908646

mm: shrink parent dentries when shrinking slab

Teach the dentry slab shrinker to aggressively shrink parent dentries when
shrinking the dentry cache.

This is done to attempt to improve the situation where the dentry slab cache
gets a lot of internal fragmentation due to pages containing directory
dentries.  It is expected that this change will cause some of those dentries
to be reaped earlier, and with less scanning.

Needs careful testing.

Cc: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -879,7 +879,7 @@
879 879 if (nr) {
880 880 if (!(gfp_mask & __GFP_FS))
881 881 return -1;
882   - prune_dcache(nr, NULL, 0);
  882 + prune_dcache(nr, NULL, 1);
883 883 }
884 884 return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
885 885 }