|
@@ -82,13 +82,13 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
|
|
|
int inodes;
|
|
|
|
|
|
/* proportion the scan between the caches */
|
|
|
- dentries = (sc->nr_to_scan * sb->s_nr_dentry_unused) /
|
|
|
- total_objects;
|
|
|
- inodes = (sc->nr_to_scan * sb->s_nr_inodes_unused) /
|
|
|
- total_objects;
|
|
|
+ dentries = mult_frac(sc->nr_to_scan, sb->s_nr_dentry_unused,
|
|
|
+ total_objects);
|
|
|
+ inodes = mult_frac(sc->nr_to_scan, sb->s_nr_inodes_unused,
|
|
|
+ total_objects);
|
|
|
if (fs_objects)
|
|
|
- fs_objects = (sc->nr_to_scan * fs_objects) /
|
|
|
- total_objects;
|
|
|
+ fs_objects = mult_frac(sc->nr_to_scan, fs_objects,
|
|
|
+ total_objects);
|
|
|
/*
|
|
|
* prune the dcache first as the icache is pinned by it, then
|
|
|
* prune the icache, followed by the filesystem specific caches
|
|
@@ -104,7 +104,7 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
|
|
|
sb->s_nr_inodes_unused + fs_objects;
|
|
|
}
|
|
|
|
|
|
- total_objects = (total_objects / 100) * sysctl_vfs_cache_pressure;
|
|
|
+ total_objects = vfs_pressure_ratio(total_objects);
|
|
|
drop_super(sb);
|
|
|
return total_objects;
|
|
|
}
|