diff options
-rw-r--r-- | include/linux/mm_inline.h | 19 | ||||
-rw-r--r-- | mm/vmscan.c | 20 |
2 files changed, 20 insertions, 19 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 37ef13d0f01e..7fbb97267556 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -81,23 +81,4 @@ static inline enum lru_list page_lru(struct page *page) | |||
81 | return lru; | 81 | return lru; |
82 | } | 82 | } |
83 | 83 | ||
84 | /** | ||
85 | * inactive_anon_is_low - check if anonymous pages need to be deactivated | ||
86 | * @zone: zone to check | ||
87 | * | ||
88 | * Returns true if the zone does not have enough inactive anon pages, | ||
89 | * meaning some active anon pages need to be deactivated. | ||
90 | */ | ||
91 | static inline int inactive_anon_is_low(struct zone *zone) | ||
92 | { | ||
93 | unsigned long active, inactive; | ||
94 | |||
95 | active = zone_page_state(zone, NR_ACTIVE_ANON); | ||
96 | inactive = zone_page_state(zone, NR_INACTIVE_ANON); | ||
97 | |||
98 | if (inactive * zone->inactive_ratio < active) | ||
99 | return 1; | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | #endif | 84 | #endif |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 45983af1de3d..f75d924cb4f4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1291,6 +1291,26 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1291 | pagevec_release(&pvec); | 1291 | pagevec_release(&pvec); |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | /** | ||
1295 | * inactive_anon_is_low - check if anonymous pages need to be deactivated | ||
1296 | * @zone: zone to check | ||
1297 | * | ||
1298 | * Returns true if the zone does not have enough inactive anon pages, | ||
1299 | * meaning some active anon pages need to be deactivated. | ||
1300 | */ | ||
1301 | static int inactive_anon_is_low(struct zone *zone) | ||
1302 | { | ||
1303 | unsigned long active, inactive; | ||
1304 | |||
1305 | active = zone_page_state(zone, NR_ACTIVE_ANON); | ||
1306 | inactive = zone_page_state(zone, NR_INACTIVE_ANON); | ||
1307 | |||
1308 | if (inactive * zone->inactive_ratio < active) | ||
1309 | return 1; | ||
1310 | |||
1311 | return 0; | ||
1312 | } | ||
1313 | |||
1294 | static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, | 1314 | static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, |
1295 | struct zone *zone, struct scan_control *sc, int priority) | 1315 | struct zone *zone, struct scan_control *sc, int priority) |
1296 | { | 1316 | { |