.. | .. |
---|
29 | 29 | /* compaction didn't start as it was deferred due to past failures */ |
---|
30 | 30 | COMPACT_DEFERRED, |
---|
31 | 31 | |
---|
32 | | - /* compaction not active last round */ |
---|
33 | | - COMPACT_INACTIVE = COMPACT_DEFERRED, |
---|
34 | | - |
---|
35 | 32 | /* For more detailed tracepoint output - internal to compaction */ |
---|
36 | 33 | COMPACT_NO_SUITABLE_PAGE, |
---|
37 | 34 | /* compaction should continue to another pageblock */ |
---|
.. | .. |
---|
85 | 82 | |
---|
86 | 83 | #ifdef CONFIG_COMPACTION |
---|
87 | 84 | extern int sysctl_compact_memory; |
---|
| 85 | +extern unsigned int sysctl_compaction_proactiveness; |
---|
88 | 86 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
---|
89 | | - void __user *buffer, size_t *length, loff_t *ppos); |
---|
| 87 | + void *buffer, size_t *length, loff_t *ppos); |
---|
| 88 | +extern int compaction_proactiveness_sysctl_handler(struct ctl_table *table, |
---|
| 89 | + int write, void *buffer, size_t *length, loff_t *ppos); |
---|
90 | 90 | extern int sysctl_extfrag_threshold; |
---|
91 | | -extern int sysctl_extfrag_handler(struct ctl_table *table, int write, |
---|
92 | | - void __user *buffer, size_t *length, loff_t *ppos); |
---|
93 | 91 | extern int sysctl_compact_unevictable_allowed; |
---|
94 | 92 | |
---|
| 93 | +extern unsigned int extfrag_for_order(struct zone *zone, unsigned int order); |
---|
95 | 94 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
---|
96 | 95 | extern enum compact_result try_to_compact_pages(gfp_t gfp_mask, |
---|
97 | 96 | unsigned int order, unsigned int alloc_flags, |
---|
98 | | - const struct alloc_context *ac, enum compact_priority prio); |
---|
| 97 | + const struct alloc_context *ac, enum compact_priority prio, |
---|
| 98 | + struct page **page); |
---|
99 | 99 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
---|
100 | 100 | extern enum compact_result compaction_suitable(struct zone *zone, int order, |
---|
101 | | - unsigned int alloc_flags, int classzone_idx); |
---|
| 101 | + unsigned int alloc_flags, int highest_zoneidx); |
---|
102 | 102 | |
---|
103 | 103 | extern void defer_compaction(struct zone *zone, int order); |
---|
104 | 104 | extern bool compaction_deferred(struct zone *zone, int order); |
---|
.. | .. |
---|
130 | 130 | return false; |
---|
131 | 131 | } |
---|
132 | 132 | |
---|
133 | | -/* |
---|
134 | | - * Compaction has backed off for some reason. It might be throttling or |
---|
135 | | - * lock contention. Retrying is still worthwhile. |
---|
136 | | - */ |
---|
137 | | -static inline bool compaction_withdrawn(enum compact_result result) |
---|
| 133 | +/* Compaction needs reclaim to be performed first, so it can continue. */ |
---|
| 134 | +static inline bool compaction_needs_reclaim(enum compact_result result) |
---|
138 | 135 | { |
---|
139 | 136 | /* |
---|
140 | 137 | * Compaction backed off due to watermark checks for order-0 |
---|
.. | .. |
---|
143 | 140 | if (result == COMPACT_SKIPPED) |
---|
144 | 141 | return true; |
---|
145 | 142 | |
---|
| 143 | + return false; |
---|
| 144 | +} |
---|
| 145 | + |
---|
| 146 | +/* |
---|
| 147 | + * Compaction has backed off for some reason after doing some work or none |
---|
| 148 | + * at all. It might be throttling or lock contention. Retrying might be still |
---|
| 149 | + * worthwhile, but with a higher priority if allowed. |
---|
| 150 | + */ |
---|
| 151 | +static inline bool compaction_withdrawn(enum compact_result result) |
---|
| 152 | +{ |
---|
146 | 153 | /* |
---|
147 | 154 | * If compaction is deferred for high-order allocations, it is |
---|
148 | 155 | * because sync compaction recently failed. If this is the case |
---|
.. | .. |
---|
176 | 183 | |
---|
177 | 184 | extern int kcompactd_run(int nid); |
---|
178 | 185 | extern void kcompactd_stop(int nid); |
---|
179 | | -extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx); |
---|
| 186 | +extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx); |
---|
| 187 | +extern unsigned long isolate_and_split_free_page(struct page *page, |
---|
| 188 | + struct list_head *list); |
---|
180 | 189 | |
---|
181 | 190 | #else |
---|
182 | 191 | static inline void reset_isolation_suitable(pg_data_t *pgdat) |
---|
.. | .. |
---|
184 | 193 | } |
---|
185 | 194 | |
---|
186 | 195 | static inline enum compact_result compaction_suitable(struct zone *zone, int order, |
---|
187 | | - int alloc_flags, int classzone_idx) |
---|
| 196 | + int alloc_flags, int highest_zoneidx) |
---|
188 | 197 | { |
---|
189 | 198 | return COMPACT_SKIPPED; |
---|
190 | 199 | } |
---|
.. | .. |
---|
208 | 217 | return false; |
---|
209 | 218 | } |
---|
210 | 219 | |
---|
| 220 | +static inline bool compaction_needs_reclaim(enum compact_result result) |
---|
| 221 | +{ |
---|
| 222 | + return false; |
---|
| 223 | +} |
---|
| 224 | + |
---|
211 | 225 | static inline bool compaction_withdrawn(enum compact_result result) |
---|
212 | 226 | { |
---|
213 | 227 | return true; |
---|
.. | .. |
---|
221 | 235 | { |
---|
222 | 236 | } |
---|
223 | 237 | |
---|
224 | | -static inline void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_idx) |
---|
| 238 | +static inline void wakeup_kcompactd(pg_data_t *pgdat, |
---|
| 239 | + int order, int highest_zoneidx) |
---|
225 | 240 | { |
---|
| 241 | +} |
---|
| 242 | + |
---|
| 243 | +static inline unsigned long isolate_and_split_free_page(struct page *page, |
---|
| 244 | + struct list_head *list) |
---|
| 245 | +{ |
---|
| 246 | + return 0; |
---|
226 | 247 | } |
---|
227 | 248 | |
---|
228 | 249 | #endif /* CONFIG_COMPACTION */ |
---|
229 | 250 | |
---|
230 | | -#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) |
---|
231 | 251 | struct node; |
---|
| 252 | +#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) |
---|
232 | 253 | extern int compaction_register_node(struct node *node); |
---|
233 | 254 | extern void compaction_unregister_node(struct node *node); |
---|
234 | 255 | |
---|