diff options
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e56f835274c9..9f7c3ebcbbad 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -273,11 +273,6 @@ struct zone_reclaim_stat { | |||
273 | */ | 273 | */ |
274 | unsigned long recent_rotated[2]; | 274 | unsigned long recent_rotated[2]; |
275 | unsigned long recent_scanned[2]; | 275 | unsigned long recent_scanned[2]; |
276 | |||
277 | /* | ||
278 | * accumulated for batching | ||
279 | */ | ||
280 | unsigned long nr_saved_scan[NR_LRU_LISTS]; | ||
281 | }; | 276 | }; |
282 | 277 | ||
283 | struct zone { | 278 | struct zone { |
@@ -652,6 +647,13 @@ typedef struct pglist_data { | |||
652 | #endif | 647 | #endif |
653 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) | 648 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) |
654 | 649 | ||
650 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | ||
651 | |||
652 | #define node_end_pfn(nid) ({\ | ||
653 | pg_data_t *__pgdat = NODE_DATA(nid);\ | ||
654 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\ | ||
655 | }) | ||
656 | |||
655 | #include <linux/memory_hotplug.h> | 657 | #include <linux/memory_hotplug.h> |
656 | 658 | ||
657 | extern struct mutex zonelists_mutex; | 659 | extern struct mutex zonelists_mutex; |
@@ -928,9 +930,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
928 | #define pfn_to_nid(pfn) (0) | 930 | #define pfn_to_nid(pfn) (0) |
929 | #endif | 931 | #endif |
930 | 932 | ||
931 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
932 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
933 | |||
934 | #ifdef CONFIG_SPARSEMEM | 933 | #ifdef CONFIG_SPARSEMEM |
935 | 934 | ||
936 | /* | 935 | /* |
@@ -956,6 +955,12 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
956 | #error Allocator MAX_ORDER exceeds SECTION_SIZE | 955 | #error Allocator MAX_ORDER exceeds SECTION_SIZE |
957 | #endif | 956 | #endif |
958 | 957 | ||
958 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
959 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
960 | |||
961 | #define SECTION_ALIGN_UP(pfn) (((pfn) + PAGES_PER_SECTION - 1) & PAGE_SECTION_MASK) | ||
962 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) | ||
963 | |||
959 | struct page; | 964 | struct page; |
960 | struct page_cgroup; | 965 | struct page_cgroup; |
961 | struct mem_section { | 966 | struct mem_section { |
@@ -1053,12 +1058,14 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn) | |||
1053 | return __nr_to_section(pfn_to_section_nr(pfn)); | 1058 | return __nr_to_section(pfn_to_section_nr(pfn)); |
1054 | } | 1059 | } |
1055 | 1060 | ||
1061 | #ifndef CONFIG_HAVE_ARCH_PFN_VALID | ||
1056 | static inline int pfn_valid(unsigned long pfn) | 1062 | static inline int pfn_valid(unsigned long pfn) |
1057 | { | 1063 | { |
1058 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | 1064 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
1059 | return 0; | 1065 | return 0; |
1060 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); | 1066 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); |
1061 | } | 1067 | } |
1068 | #endif | ||
1062 | 1069 | ||
1063 | static inline int pfn_present(unsigned long pfn) | 1070 | static inline int pfn_present(unsigned long pfn) |
1064 | { | 1071 | { |