diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm_inline.h | 19 | ||||
-rw-r--r-- | include/linux/mmzone.h | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 2eb599465d56..f451fedd1e75 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -117,4 +117,23 @@ static inline enum lru_list page_lru(struct page *page) | |||
117 | return lru; | 117 | return lru; |
118 | } | 118 | } |
119 | 119 | ||
120 | /** | ||
121 | * inactive_anon_is_low - check if anonymous pages need to be deactivated | ||
122 | * @zone: zone to check | ||
123 | * | ||
124 | * Returns true if the zone does not have enough inactive anon pages, | ||
125 | * meaning some active anon pages need to be deactivated. | ||
126 | */ | ||
127 | static inline int inactive_anon_is_low(struct zone *zone) | ||
128 | { | ||
129 | unsigned long active, inactive; | ||
130 | |||
131 | active = zone_page_state(zone, NR_ACTIVE_ANON); | ||
132 | inactive = zone_page_state(zone, NR_INACTIVE_ANON); | ||
133 | |||
134 | if (inactive * zone->inactive_ratio < active) | ||
135 | return 1; | ||
136 | |||
137 | return 0; | ||
138 | } | ||
120 | #endif | 139 | #endif |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 59a4c8fd6ebd..9c5111f49a32 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -323,6 +323,12 @@ struct zone { | |||
323 | */ | 323 | */ |
324 | int prev_priority; | 324 | int prev_priority; |
325 | 325 | ||
326 | /* | ||
327 | * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on | ||
328 | * this zone's LRU. Maintained by the pageout code. | ||
329 | */ | ||
330 | unsigned int inactive_ratio; | ||
331 | |||
326 | 332 | ||
327 | ZONE_PADDING(_pad2_) | 333 | ZONE_PADDING(_pad2_) |
328 | /* Rarely used or read-mostly fields */ | 334 | /* Rarely used or read-mostly fields */ |