[prev in list] [next in list] [prev in thread] [next in thread]
List: openvz-devel
Subject: [Devel] [PATCH rh7 2/2] mm/vmscan/HACK: scan only anon if global file inactive isn't low.
From: Andrey Ryabinin <aryabinin () virtuozzo ! com>
Date: 2017-11-23 9:40:33
Message-ID: 20171123094033.9954-2-aryabinin () virtuozzo ! com
[Download RAW message or body]
Avoid swapping if global inactive list is big.
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
mm/vmscan.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 524d1452deb1..798e013757f1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2064,6 +2064,22 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
}
}
+ if (global_reclaim(sc)) {
+ unsigned long inactive = zone_page_state(zone, NR_INACTIVE_FILE);
+ unsigned long active = zone_page_state(zone, NR_ACTIVE_FILE);
+ unsigned long gb, inactive_ratio;
+
+ gb = (inactive + active) >> (30 - PAGE_SHIFT);
+ if (gb)
+ inactive_ratio = int_sqrt(10 * gb);
+ else
+ inactive_ratio = 1;
+ if (inactive_ratio * inactive >= active) {
+ scan_balance = SCAN_FILE;
+ goto out;
+ }
+ }
+
/*
* There is enough inactive page cache, do not reclaim
* anything from the anonymous working set right now.
--
2.13.6
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic