[Devel] [PATCH RHEL7 COMMIT] tcache: account reclaimed pages to scan_control->nr_reclaimed

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 18 05:05:33 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 rh7-3.10.0-229.7.2.vz7.9.10
------>
commit 8a5c219c8107c30f19d7f0ec0c3b0c016dafb637
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Wed Nov 18 17:05:33 2015 +0400

    tcache: account reclaimed pages to scan_control->nr_reclaimed
    
    Tcache pages might constitute a substantial portion of the total number
    of pages reclaimed. Since they are freed immediately, we should count
    them to scan_control->nr_reclaimed to avoid premature scan->priority
    drops and resulting overreclaim.
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
 mm/tcache.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/tcache.c b/mm/tcache.c
index ce5b0ed..e8ffa91 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -17,6 +17,7 @@
 #include <linux/completion.h>
 #include <linux/shrinker.h>
 #include <linux/vmstat.h>
+#include <linux/swap.h>
 #include <linux/cleancache.h>
 
 /* cleancache_put_page is called from atomic context */
@@ -808,6 +809,8 @@ static unsigned long tcache_shrink_scan(struct shrinker *shrink,
 		}
 		sc->nr_to_scan--;
 	}
+	if (current->reclaim_state)
+		current->reclaim_state->reclaimed_slab += nr_reclaimed;
 	return nr_reclaimed;
 }
 


More information about the Devel mailing list