aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 188cb2ffe8db..650ba2fb3301 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -140,25 +140,29 @@ enum lru_list {
140 NR_LRU_LISTS 140 NR_LRU_LISTS
141}; 141};
142 142
143#define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++) 143#define for_each_lru(lru) for (lru = 0; lru < NR_LRU_LISTS; lru++)
144 144
145#define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++) 145#define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++)
146 146
147static inline int is_file_lru(enum lru_list l) 147static inline int is_file_lru(enum lru_list lru)
148{ 148{
149 return (l == LRU_INACTIVE_FILE || l == LRU_ACTIVE_FILE); 149 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
150} 150}
151 151
152static inline int is_active_lru(enum lru_list l) 152static inline int is_active_lru(enum lru_list lru)
153{ 153{
154 return (l == LRU_ACTIVE_ANON || l == LRU_ACTIVE_FILE); 154 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
155} 155}
156 156
157static inline int is_unevictable_lru(enum lru_list l) 157static inline int is_unevictable_lru(enum lru_list lru)
158{ 158{
159 return (l == LRU_UNEVICTABLE); 159 return (lru == LRU_UNEVICTABLE);
160} 160}
161 161
162struct lruvec {
163 struct list_head lists[NR_LRU_LISTS];
164};
165
162/* Mask used at gathering information at once (see memcontrol.c) */ 166/* Mask used at gathering information at once (see memcontrol.c) */
163#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) 167#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
164#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) 168#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
@@ -173,6 +177,8 @@ static inline int is_unevictable_lru(enum lru_list l)
173#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4) 177#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4)
174/* Isolate unmapped file */ 178/* Isolate unmapped file */
175#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8) 179#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8)
180/* Isolate for asynchronous migration */
181#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10)
176 182
177/* LRU Isolation modes. */ 183/* LRU Isolation modes. */
178typedef unsigned __bitwise__ isolate_mode_t; 184typedef unsigned __bitwise__ isolate_mode_t;
@@ -317,6 +323,12 @@ struct zone {
317 */ 323 */
318 unsigned long lowmem_reserve[MAX_NR_ZONES]; 324 unsigned long lowmem_reserve[MAX_NR_ZONES];
319 325
326 /*
327 * This is a per-zone reserve of pages that should not be
328 * considered dirtyable memory.
329 */
330 unsigned long dirty_balance_reserve;
331
320#ifdef CONFIG_NUMA 332#ifdef CONFIG_NUMA
321 int node; 333 int node;
322 /* 334 /*
@@ -358,10 +370,8 @@ struct zone {
358 ZONE_PADDING(_pad1_) 370 ZONE_PADDING(_pad1_)
359 371
360 /* Fields commonly accessed by the page reclaim scanner */ 372 /* Fields commonly accessed by the page reclaim scanner */
361 spinlock_t lru_lock; 373 spinlock_t lru_lock;
362 struct zone_lru { 374 struct lruvec lruvec;
363 struct list_head list;
364 } lru[NR_LRU_LISTS];
365 375
366 struct zone_reclaim_stat reclaim_stat; 376 struct zone_reclaim_stat reclaim_stat;
367 377
@@ -598,13 +608,13 @@ struct zonelist {
598#endif 608#endif
599}; 609};
600 610
601#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 611#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
602struct node_active_region { 612struct node_active_region {
603 unsigned long start_pfn; 613 unsigned long start_pfn;
604 unsigned long end_pfn; 614 unsigned long end_pfn;
605 int nid; 615 int nid;
606}; 616};
607#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ 617#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
608 618
609#ifndef CONFIG_DISCONTIGMEM 619#ifndef CONFIG_DISCONTIGMEM
610/* The array of struct pages - for discontigmem use pgdat->lmem_map */ 620/* The array of struct pages - for discontigmem use pgdat->lmem_map */
@@ -720,7 +730,7 @@ extern int movable_zone;
720 730
721static inline int zone_movable_is_highmem(void) 731static inline int zone_movable_is_highmem(void)
722{ 732{
723#if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP) 733#if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE)
724 return movable_zone == ZONE_HIGHMEM; 734 return movable_zone == ZONE_HIGHMEM;
725#else 735#else
726 return 0; 736 return 0;
@@ -938,7 +948,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
938#endif 948#endif
939 949
940#if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \ 950#if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \
941 !defined(CONFIG_ARCH_POPULATES_NODE_MAP) 951 !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
942static inline unsigned long early_pfn_to_nid(unsigned long pfn) 952static inline unsigned long early_pfn_to_nid(unsigned long pfn)
943{ 953{
944 return 0; 954 return 0;