diff options
Diffstat (limited to 'include/linux/compaction.h')
| -rw-r--r-- | include/linux/compaction.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index ef658147e4e8..6ecb6dc2f303 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
| @@ -22,8 +22,9 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
| 22 | extern int fragmentation_index(struct zone *zone, unsigned int order); | 22 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
| 23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
| 24 | int order, gfp_t gfp_mask, nodemask_t *mask, | 24 | int order, gfp_t gfp_mask, nodemask_t *mask, |
| 25 | bool sync, bool *contended); | 25 | bool sync, bool *contended, struct page **page); |
| 26 | extern int compact_pgdat(pg_data_t *pgdat, int order); | 26 | extern int compact_pgdat(pg_data_t *pgdat, int order); |
| 27 | extern void reset_isolation_suitable(pg_data_t *pgdat); | ||
| 27 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 28 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
| 28 | 29 | ||
| 29 | /* Do not skip compaction more than 64 times */ | 30 | /* Do not skip compaction more than 64 times */ |
| @@ -61,10 +62,20 @@ static inline bool compaction_deferred(struct zone *zone, int order) | |||
| 61 | return zone->compact_considered < defer_limit; | 62 | return zone->compact_considered < defer_limit; |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 65 | /* Returns true if restarting compaction after many failures */ | ||
| 66 | static inline bool compaction_restarting(struct zone *zone, int order) | ||
| 67 | { | ||
| 68 | if (order < zone->compact_order_failed) | ||
| 69 | return false; | ||
| 70 | |||
| 71 | return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT && | ||
| 72 | zone->compact_considered >= 1UL << zone->compact_defer_shift; | ||
| 73 | } | ||
| 74 | |||
| 64 | #else | 75 | #else |
| 65 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 76 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, |
| 66 | int order, gfp_t gfp_mask, nodemask_t *nodemask, | 77 | int order, gfp_t gfp_mask, nodemask_t *nodemask, |
| 67 | bool sync, bool *contended) | 78 | bool sync, bool *contended, struct page **page) |
| 68 | { | 79 | { |
| 69 | return COMPACT_CONTINUE; | 80 | return COMPACT_CONTINUE; |
| 70 | } | 81 | } |
| @@ -74,6 +85,10 @@ static inline int compact_pgdat(pg_data_t *pgdat, int order) | |||
| 74 | return COMPACT_CONTINUE; | 85 | return COMPACT_CONTINUE; |
| 75 | } | 86 | } |
| 76 | 87 | ||
| 88 | static inline void reset_isolation_suitable(pg_data_t *pgdat) | ||
| 89 | { | ||
| 90 | } | ||
| 91 | |||
| 77 | static inline unsigned long compaction_suitable(struct zone *zone, int order) | 92 | static inline unsigned long compaction_suitable(struct zone *zone, int order) |
| 78 | { | 93 | { |
| 79 | return COMPACT_SKIPPED; | 94 | return COMPACT_SKIPPED; |
