shrinker->seeks is supposed to be an estimate of the number of disk seeks needed to recreate an object. shrink_slab will divide lru scan ratio over ->seeks to scan objects that need more seeks to be brought back less intensively.
For most shrinkers (e.g. dcache, icache) ->seeks equals 2 (aka DEFAULT_SEEKS), because rereading an object requires random IO (you need seek to the object and seek back), in contrast to page cache which can benefit from read-ahead. Hence dcache experiences half pressure exerted upon lru pages. However, tmem is not like dcache - tmem pages are created from lru pages so they should receive the same pressure. That said, let's set ->seeks to 1 for tmem shrinkers. Signed-off-by: Vladimir Davydov <[email protected]> --- mm/tswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/tswap.c b/mm/tswap.c index dc1253f8e5b2..01953b4e111e 100644 --- a/mm/tswap.c +++ b/mm/tswap.c @@ -250,7 +250,7 @@ static unsigned long tswap_shrink_scan(struct shrinker *shrink, static struct shrinker tswap_shrinker = { .count_objects = tswap_shrink_count, .scan_objects = tswap_shrink_scan, - .seeks = DEFAULT_SEEKS, + .seeks = 1, .flags = SHRINKER_NUMA_AWARE, }; -- 2.1.4 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
