diff options
Diffstat (limited to 'include/linux/mmzone.h')
| -rw-r--r-- | include/linux/mmzone.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d09b1345a3a1..da8eb8ad9e9b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -24,6 +24,14 @@ | |||
| 24 | #endif | 24 | #endif |
| 25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) | 25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) |
| 26 | 26 | ||
| 27 | /* | ||
| 28 | * PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed | ||
| 29 | * costly to service. That is between allocation orders which should | ||
| 30 | * coelesce naturally under reasonable reclaim pressure and those which | ||
| 31 | * will not. | ||
| 32 | */ | ||
| 33 | #define PAGE_ALLOC_COSTLY_ORDER 3 | ||
| 34 | |||
| 27 | struct free_area { | 35 | struct free_area { |
| 28 | struct list_head free_list; | 36 | struct list_head free_list; |
| 29 | unsigned long nr_free; | 37 | unsigned long nr_free; |
| @@ -146,6 +154,7 @@ enum zone_type { | |||
| 146 | */ | 154 | */ |
| 147 | ZONE_HIGHMEM, | 155 | ZONE_HIGHMEM, |
| 148 | #endif | 156 | #endif |
| 157 | ZONE_MOVABLE, | ||
| 149 | MAX_NR_ZONES | 158 | MAX_NR_ZONES |
| 150 | }; | 159 | }; |
| 151 | 160 | ||
| @@ -167,6 +176,7 @@ enum zone_type { | |||
| 167 | + defined(CONFIG_ZONE_DMA32) \ | 176 | + defined(CONFIG_ZONE_DMA32) \ |
| 168 | + 1 \ | 177 | + 1 \ |
| 169 | + defined(CONFIG_HIGHMEM) \ | 178 | + defined(CONFIG_HIGHMEM) \ |
| 179 | + 1 \ | ||
| 170 | ) | 180 | ) |
| 171 | #if __ZONE_COUNT < 2 | 181 | #if __ZONE_COUNT < 2 |
| 172 | #define ZONES_SHIFT 0 | 182 | #define ZONES_SHIFT 0 |
| @@ -499,10 +509,22 @@ static inline int populated_zone(struct zone *zone) | |||
| 499 | return (!!zone->present_pages); | 509 | return (!!zone->present_pages); |
| 500 | } | 510 | } |
| 501 | 511 | ||
| 512 | extern int movable_zone; | ||
| 513 | |||
| 514 | static inline int zone_movable_is_highmem(void) | ||
| 515 | { | ||
| 516 | #if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP) | ||
| 517 | return movable_zone == ZONE_HIGHMEM; | ||
| 518 | #else | ||
| 519 | return 0; | ||
| 520 | #endif | ||
| 521 | } | ||
| 522 | |||
| 502 | static inline int is_highmem_idx(enum zone_type idx) | 523 | static inline int is_highmem_idx(enum zone_type idx) |
| 503 | { | 524 | { |
| 504 | #ifdef CONFIG_HIGHMEM | 525 | #ifdef CONFIG_HIGHMEM |
| 505 | return (idx == ZONE_HIGHMEM); | 526 | return (idx == ZONE_HIGHMEM || |
| 527 | (idx == ZONE_MOVABLE && zone_movable_is_highmem())); | ||
| 506 | #else | 528 | #else |
| 507 | return 0; | 529 | return 0; |
| 508 | #endif | 530 | #endif |
| @@ -522,7 +544,9 @@ static inline int is_normal_idx(enum zone_type idx) | |||
| 522 | static inline int is_highmem(struct zone *zone) | 544 | static inline int is_highmem(struct zone *zone) |
| 523 | { | 545 | { |
| 524 | #ifdef CONFIG_HIGHMEM | 546 | #ifdef CONFIG_HIGHMEM |
| 525 | return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; | 547 | int zone_idx = zone - zone->zone_pgdat->node_zones; |
| 548 | return zone_idx == ZONE_HIGHMEM || | ||
| 549 | (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem()); | ||
| 526 | #else | 550 | #else |
| 527 | return 0; | 551 | return 0; |
| 528 | #endif | 552 | #endif |
| @@ -566,6 +590,11 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | |||
| 566 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 590 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
| 567 | struct file *, void __user *, size_t *, loff_t *); | 591 | struct file *, void __user *, size_t *, loff_t *); |
| 568 | 592 | ||
| 593 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | ||
| 594 | struct file *, void __user *, size_t *, loff_t *); | ||
| 595 | extern char numa_zonelist_order[]; | ||
| 596 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | ||
| 597 | |||
| 569 | #include <linux/topology.h> | 598 | #include <linux/topology.h> |
| 570 | /* Returns the number of the current Node. */ | 599 | /* Returns the number of the current Node. */ |
| 571 | #ifndef numa_node_id | 600 | #ifndef numa_node_id |
