[Devel] [PATCH RHEL7 COMMIT] mm/vmscan: inactive_list_is_low() to work on both file and anon lru lists

Konstantin Khorenko khorenko at virtuozzo.com
Mon Apr 1 12:27:17 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.85.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.85.7
------>
commit e718c7aece018610cd248419d1f470f074c2eb6a
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Fri Mar 29 20:05:22 2019 +0300

    mm/vmscan: inactive_list_is_low() to work on both file and anon lru lists
    
    At the moment inactive_list_is_low() mistakenly checks FILE list
    whatever (file or anon) list is asked to check.
    
    Honor list type argument.
    
    Fixes: 1f45c6c57160 ("mm/vmscan: active lru protection fixups.")
    https://jira.sw.ru/browse/PSBM-92480
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    Acked-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/vmscan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1f5f48dd3cf1..74d3e8c61cf7 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2008,7 +2008,9 @@ static void shrink_active_list(unsigned long nr_to_scan,
 static int inactive_list_is_low(struct lruvec *lruvec, bool file,
 				struct mem_cgroup *memcg, bool actual_reclaim)
 {
+	enum lru_list active_lru = file * LRU_FILE + LRU_ACTIVE;
 	struct zone *zone = lruvec_zone(lruvec);
+	enum lru_list inactive_lru = file * LRU_FILE;
 	unsigned long inactive_ratio;
 	unsigned long inactive;
 	unsigned long active;
@@ -2022,8 +2024,8 @@ static int inactive_list_is_low(struct lruvec *lruvec, bool file,
 	if (!file && !total_swap_pages)
 		return false;
 
-	inactive = lruvec_lru_size(lruvec, LRU_INACTIVE_FILE);
-	active = lruvec_lru_size(lruvec, LRU_ACTIVE_FILE);
+	inactive = lruvec_lru_size(lruvec, inactive_lru);
+	active = lruvec_lru_size(lruvec, active_lru);
 
 	if (memcg)
 		refaults = memcg_ws_activates(memcg);



More information about the Devel mailing list