[Devel] [PATCH RHEL7 COMMIT] tswap: exert equal pressure on tmem and lru pages

Konstantin Khorenko khorenko at virtuozzo.com
Wed Dec 2 07:09:49 PST 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rebase
------>
commit 2701e4296dc6c17f5afae5b70b50933f0eca9ca5
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Wed Dec 2 19:09:49 2015 +0400

    tswap: exert equal pressure on tmem and lru pages
    
    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 <vdavydov at virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai at odin.com>
---
 mm/tswap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/tswap.c b/mm/tswap.c
index dc1253f..01953b4 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,
 };
 


More information about the Devel mailing list