Эх сурвалжийг харах

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>
Andrew Morton 18 жил өмнө
parent
commit
24c32d733d
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      fs/dcache.c

+ 1 - 1
fs/dcache.c

@@ -879,7 +879,7 @@ static int shrink_dcache_memory(int nr, gfp_t gfp_mask)
 	if (nr) {
 	if (nr) {
 		if (!(gfp_mask & __GFP_FS))
 		if (!(gfp_mask & __GFP_FS))
 			return -1;
 			return -1;
-		prune_dcache(nr, NULL, 0);
+		prune_dcache(nr, NULL, 1);
 	}
 	}
 	return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
 	return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
 }
 }