diff options
Diffstat (limited to 'mm/internal.h')
-rw-r--r-- | mm/internal.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/mm/internal.h b/mm/internal.h index 2189af491783..2ba87fbfb75b 100644 --- a/mm/internal.h +++ b/mm/internal.h | |||
@@ -100,6 +100,39 @@ extern void prep_compound_page(struct page *page, unsigned long order); | |||
100 | extern bool is_free_buddy_page(struct page *page); | 100 | extern bool is_free_buddy_page(struct page *page); |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #if defined CONFIG_COMPACTION || defined CONFIG_CMA | ||
104 | |||
105 | /* | ||
106 | * in mm/compaction.c | ||
107 | */ | ||
108 | /* | ||
109 | * compact_control is used to track pages being migrated and the free pages | ||
110 | * they are being migrated to during memory compaction. The free_pfn starts | ||
111 | * at the end of a zone and migrate_pfn begins at the start. Movable pages | ||
112 | * are moved to the end of a zone during a compaction run and the run | ||
113 | * completes when free_pfn <= migrate_pfn | ||
114 | */ | ||
115 | struct compact_control { | ||
116 | struct list_head freepages; /* List of free pages to migrate to */ | ||
117 | struct list_head migratepages; /* List of pages being migrated */ | ||
118 | unsigned long nr_freepages; /* Number of isolated free pages */ | ||
119 | unsigned long nr_migratepages; /* Number of pages to migrate */ | ||
120 | unsigned long free_pfn; /* isolate_freepages search base */ | ||
121 | unsigned long migrate_pfn; /* isolate_migratepages search base */ | ||
122 | bool sync; /* Synchronous migration */ | ||
123 | |||
124 | int order; /* order a direct compactor needs */ | ||
125 | int migratetype; /* MOVABLE, RECLAIMABLE etc */ | ||
126 | struct zone *zone; | ||
127 | }; | ||
128 | |||
129 | unsigned long | ||
130 | isolate_freepages_range(unsigned long start_pfn, unsigned long end_pfn); | ||
131 | unsigned long | ||
132 | isolate_migratepages_range(struct zone *zone, struct compact_control *cc, | ||
133 | unsigned long low_pfn, unsigned long end_pfn); | ||
134 | |||
135 | #endif | ||
103 | 136 | ||
104 | /* | 137 | /* |
105 | * function for dealing with page's order in buddy system. | 138 | * function for dealing with page's order in buddy system. |
@@ -131,7 +164,8 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma) | |||
131 | * to determine if it's being mapped into a LOCKED vma. | 164 | * to determine if it's being mapped into a LOCKED vma. |
132 | * If so, mark page as mlocked. | 165 | * If so, mark page as mlocked. |
133 | */ | 166 | */ |
134 | static inline int is_mlocked_vma(struct vm_area_struct *vma, struct page *page) | 167 | static inline int mlocked_vma_newpage(struct vm_area_struct *vma, |
168 | struct page *page) | ||
135 | { | 169 | { |
136 | VM_BUG_ON(PageLRU(page)); | 170 | VM_BUG_ON(PageLRU(page)); |
137 | 171 | ||
@@ -189,7 +223,7 @@ extern unsigned long vma_address(struct page *page, | |||
189 | struct vm_area_struct *vma); | 223 | struct vm_area_struct *vma); |
190 | #endif | 224 | #endif |
191 | #else /* !CONFIG_MMU */ | 225 | #else /* !CONFIG_MMU */ |
192 | static inline int is_mlocked_vma(struct vm_area_struct *v, struct page *p) | 226 | static inline int mlocked_vma_newpage(struct vm_area_struct *v, struct page *p) |
193 | { | 227 | { |
194 | return 0; | 228 | return 0; |
195 | } | 229 | } |
@@ -309,3 +343,7 @@ extern u64 hwpoison_filter_flags_mask; | |||
309 | extern u64 hwpoison_filter_flags_value; | 343 | extern u64 hwpoison_filter_flags_value; |
310 | extern u64 hwpoison_filter_memcg; | 344 | extern u64 hwpoison_filter_memcg; |
311 | extern u32 hwpoison_filter_enable; | 345 | extern u32 hwpoison_filter_enable; |
346 | |||
347 | extern unsigned long vm_mmap_pgoff(struct file *, unsigned long, | ||
348 | unsigned long, unsigned long, | ||
349 | unsigned long, unsigned long); | ||