diff options
Diffstat (limited to 'include/linux/mmzone.h')
| -rw-r--r-- | include/linux/mmzone.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fac5509c18f0..6cbd1b6c3d20 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -75,9 +75,18 @@ enum { | |||
| 75 | 75 | ||
| 76 | extern int page_group_by_mobility_disabled; | 76 | extern int page_group_by_mobility_disabled; |
| 77 | 77 | ||
| 78 | static inline int get_pageblock_migratetype(struct page *page) | 78 | #define NR_MIGRATETYPE_BITS (PB_migrate_end - PB_migrate + 1) |
| 79 | #define MIGRATETYPE_MASK ((1UL << NR_MIGRATETYPE_BITS) - 1) | ||
| 80 | |||
| 81 | #define get_pageblock_migratetype(page) \ | ||
| 82 | get_pfnblock_flags_mask(page, page_to_pfn(page), \ | ||
| 83 | PB_migrate_end, MIGRATETYPE_MASK) | ||
| 84 | |||
| 85 | static inline int get_pfnblock_migratetype(struct page *page, unsigned long pfn) | ||
| 79 | { | 86 | { |
| 80 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); | 87 | BUILD_BUG_ON(PB_migrate_end - PB_migrate != 2); |
| 88 | return get_pfnblock_flags_mask(page, pfn, PB_migrate_end, | ||
| 89 | MIGRATETYPE_MASK); | ||
| 81 | } | 90 | } |
| 82 | 91 | ||
| 83 | struct free_area { | 92 | struct free_area { |
| @@ -360,9 +369,10 @@ struct zone { | |||
| 360 | /* Set to true when the PG_migrate_skip bits should be cleared */ | 369 | /* Set to true when the PG_migrate_skip bits should be cleared */ |
| 361 | bool compact_blockskip_flush; | 370 | bool compact_blockskip_flush; |
| 362 | 371 | ||
| 363 | /* pfns where compaction scanners should start */ | 372 | /* pfn where compaction free scanner should start */ |
| 364 | unsigned long compact_cached_free_pfn; | 373 | unsigned long compact_cached_free_pfn; |
| 365 | unsigned long compact_cached_migrate_pfn; | 374 | /* pfn where async and sync compaction migration scanner should start */ |
| 375 | unsigned long compact_cached_migrate_pfn[2]; | ||
| 366 | #endif | 376 | #endif |
| 367 | #ifdef CONFIG_MEMORY_HOTPLUG | 377 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 368 | /* see spanned/present_pages for more description */ | 378 | /* see spanned/present_pages for more description */ |
| @@ -481,9 +491,8 @@ struct zone { | |||
| 481 | * give them a chance of being in the same cacheline. | 491 | * give them a chance of being in the same cacheline. |
| 482 | * | 492 | * |
| 483 | * Write access to present_pages at runtime should be protected by | 493 | * Write access to present_pages at runtime should be protected by |
| 484 | * lock_memory_hotplug()/unlock_memory_hotplug(). Any reader who can't | 494 | * mem_hotplug_begin/end(). Any reader who can't tolerant drift of |
| 485 | * tolerant drift of present_pages should hold memory hotplug lock to | 495 | * present_pages should get_online_mems() to get a stable value. |
| 486 | * get a stable value. | ||
| 487 | * | 496 | * |
| 488 | * Read access to managed_pages should be safe because it's unsigned | 497 | * Read access to managed_pages should be safe because it's unsigned |
| 489 | * long. Write access to zone->managed_pages and totalram_pages are | 498 | * long. Write access to zone->managed_pages and totalram_pages are |
| @@ -763,10 +772,10 @@ typedef struct pglist_data { | |||
| 763 | unsigned long node_spanned_pages; /* total size of physical page | 772 | unsigned long node_spanned_pages; /* total size of physical page |
| 764 | range, including holes */ | 773 | range, including holes */ |
| 765 | int node_id; | 774 | int node_id; |
| 766 | nodemask_t reclaim_nodes; /* Nodes allowed to reclaim from */ | ||
| 767 | wait_queue_head_t kswapd_wait; | 775 | wait_queue_head_t kswapd_wait; |
| 768 | wait_queue_head_t pfmemalloc_wait; | 776 | wait_queue_head_t pfmemalloc_wait; |
| 769 | struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ | 777 | struct task_struct *kswapd; /* Protected by |
| 778 | mem_hotplug_begin/end() */ | ||
| 770 | int kswapd_max_order; | 779 | int kswapd_max_order; |
| 771 | enum zone_type classzone_idx; | 780 | enum zone_type classzone_idx; |
| 772 | #ifdef CONFIG_NUMA_BALANCING | 781 | #ifdef CONFIG_NUMA_BALANCING |
| @@ -808,10 +817,10 @@ static inline bool pgdat_is_empty(pg_data_t *pgdat) | |||
| 808 | extern struct mutex zonelists_mutex; | 817 | extern struct mutex zonelists_mutex; |
| 809 | void build_all_zonelists(pg_data_t *pgdat, struct zone *zone); | 818 | void build_all_zonelists(pg_data_t *pgdat, struct zone *zone); |
| 810 | void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx); | 819 | void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx); |
| 811 | bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 820 | bool zone_watermark_ok(struct zone *z, unsigned int order, |
| 812 | int classzone_idx, int alloc_flags); | 821 | unsigned long mark, int classzone_idx, int alloc_flags); |
| 813 | bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark, | 822 | bool zone_watermark_ok_safe(struct zone *z, unsigned int order, |
| 814 | int classzone_idx, int alloc_flags); | 823 | unsigned long mark, int classzone_idx, int alloc_flags); |
| 815 | enum memmap_context { | 824 | enum memmap_context { |
| 816 | MEMMAP_EARLY, | 825 | MEMMAP_EARLY, |
| 817 | MEMMAP_HOTPLUG, | 826 | MEMMAP_HOTPLUG, |
