aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c11
-rw-r--r--mm/vmscan.c19
2 files changed, 6 insertions, 24 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 60d28e36f0e0..af4b04f4d744 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1396,17 +1396,6 @@ int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec)
1396 return inactive * inactive_ratio < active; 1396 return inactive * inactive_ratio < active;
1397} 1397}
1398 1398
1399int mem_cgroup_inactive_file_is_low(struct lruvec *lruvec)
1400{
1401 unsigned long active;
1402 unsigned long inactive;
1403
1404 inactive = mem_cgroup_get_lru_size(lruvec, LRU_INACTIVE_FILE);
1405 active = mem_cgroup_get_lru_size(lruvec, LRU_ACTIVE_FILE);
1406
1407 return (active > inactive);
1408}
1409
1410#define mem_cgroup_from_res_counter(counter, member) \ 1399#define mem_cgroup_from_res_counter(counter, member) \
1411 container_of(counter, struct mem_cgroup, member) 1400 container_of(counter, struct mem_cgroup, member)
1412 1401
diff --git a/mm/vmscan.c b/mm/vmscan.c
index b7d8015a6d54..396ecee281d0 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1579,16 +1579,6 @@ static inline int inactive_anon_is_low(struct lruvec *lruvec)
1579} 1579}
1580#endif 1580#endif
1581 1581
1582static int inactive_file_is_low_global(struct zone *zone)
1583{
1584 unsigned long active, inactive;
1585
1586 active = zone_page_state(zone, NR_ACTIVE_FILE);
1587 inactive = zone_page_state(zone, NR_INACTIVE_FILE);
1588
1589 return (active > inactive);
1590}
1591
1592/** 1582/**
1593 * inactive_file_is_low - check if file pages need to be deactivated 1583 * inactive_file_is_low - check if file pages need to be deactivated
1594 * @lruvec: LRU vector to check 1584 * @lruvec: LRU vector to check
@@ -1605,10 +1595,13 @@ static int inactive_file_is_low_global(struct zone *zone)
1605 */ 1595 */
1606static int inactive_file_is_low(struct lruvec *lruvec) 1596static int inactive_file_is_low(struct lruvec *lruvec)
1607{ 1597{
1608 if (!mem_cgroup_disabled()) 1598 unsigned long inactive;
1609 return mem_cgroup_inactive_file_is_low(lruvec); 1599 unsigned long active;
1600
1601 inactive = get_lru_size(lruvec, LRU_INACTIVE_FILE);
1602 active = get_lru_size(lruvec, LRU_ACTIVE_FILE);
1610 1603
1611 return inactive_file_is_low_global(lruvec_zone(lruvec)); 1604 return active > inactive;
1612} 1605}
1613 1606
1614static int inactive_list_is_low(struct lruvec *lruvec, enum lru_list lru) 1607static int inactive_list_is_low(struct lruvec *lruvec, enum lru_list lru)